예제 #1
0
        public void Setup()
        {
            mapper = new MapperConfiguration(mc =>
            {
                mc.AddProfile(new MappingProfile());
            }).CreateMapper();

            factory        = new UnitOfWorkFactory();
            repoLifeEvent  = factory.CreateUnitOfWork().LifeEvents;
            modelLifeEvent = new LifeEventModel(factory, mapper);
        }
예제 #2
0
        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>();
        }
예제 #3
0
 public UnitOfWork(ILifeEventRepository lifeEventRepository)
 {
     this.LifeEvents = lifeEventRepository;
 }