示例#1
0
        public LTMSeed(IServiceCollection services)
        {
            IServiceProvider provider = services.BuildServiceProvider();

            _context        = provider.GetService <LTMDataContext>();
            _userHandler    = provider.GetService <UserCommandHandler>();
            _productHandler = provider.GetService <ProductCommandHandler>();
        }
示例#2
0
        private IUserService GetUserService()
        {
            IUnitOfWork     _uow            = new UnitOfWork();
            LTMDataContext  _context        = new LTMDataContext(_uow);
            IUserRepository _userRepository = new UserRepository(_uow, _context);
            var             _handler        = new UserCommandHandler(_userRepository);
            IUserService    userApp         = new UserService(_uow, _userRepository, _handler);

            return(userApp);
        }
示例#3
0
 public ProductRepository(IUnitOfWork uow, LTMDataContext context) : base(uow, context)
 {
     _context = context;
 }