Benutzer:MovGP0/Dependency Injection

aus Wikipedia, der freien Enzyklopädie


Dependency Injection

Autofac

var builder = new ContainerBuilder();

// Type
builder.RegisterType<DayService>().As<IDayService>();

// Factory
builder.Register(context => PublicHolidayServiceFactory.Create(context.Resolve<IAsyncDocumentSession>())).As<IPublicHolidayService().SingleInstance();

Internetquellen