public LTMSeed(IServiceCollection services) { IServiceProvider provider = services.BuildServiceProvider(); _context = provider.GetService <LTMDataContext>(); _userHandler = provider.GetService <UserCommandHandler>(); _productHandler = provider.GetService <ProductCommandHandler>(); }
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); }
public ProductRepository(IUnitOfWork uow, LTMDataContext context) : base(uow, context) { _context = context; }