dependencies - Envivo-Software/Envivo.Fresnel GitHub Wiki

Dependencies

Dependencies are used to cleanly encapsulate some operation in the domain. They may range from validation code through to complex calculations. Fresnel injects dependencies via constructors, properties, or method parameters.

Important: For the most part, Dependencies should be stateless.

If you create dependencies that implement Fresnel's built-in interfaces (i.e. anything that inherits from IDomainDependency), those dependencies are registered automatically with the internal DI container.

If you have a dependency that Fresnel doesn't recognise, you will have to register it manually in the bootstrapper:

serviceCollection.AddScoped<YourDependencyHere>();

Fresnel has several types of Dependencies, which are described in the following sections.