public void Setup() { serviceProvider = new ServiceCollection() .AddTransient <ILifeEventRepository, LifeEventRepository>() .AddTransient <IUnitOfWork, UnitOfWork>() .AddSingleton <ILifeEventDao, LifeEventDao>() //.AddSingleton<Mapper>() //.AddSingleton<ILifeEventService, LifeEventService>() .BuildServiceProvider(); mapper = new MapperConfiguration(mc => { mc.AddProfile(new MappingProfile()); }).CreateMapper(); var unit = serviceProvider.GetService <IUnitOfWork>(); repoLifeEvent = unit.LifeEvents; lifeEventService = serviceProvider.GetService <ILifeEventService>(); }
public LifeEventController(ILifeEventService lifeEventService, IPersonService personService) { this.lifeEventService = lifeEventService; }
public LifeEventController(ILifeEventService lifeEventService) { this.lifeEventService = lifeEventService; }