Exemplo n.º 1
0
        public ShopCommand(IShopDbContext dbContext, IModelsFactory modelsFactory)
        {
            Guard.WhenArgument(dbContext, DbContextCheck).IsNull().Throw();
            Guard.WhenArgument(modelsFactory, ModelsFactoryCheck).IsNull().Throw();

            this.DbContext     = dbContext;
            this.ModelsFactory = modelsFactory;
        }
Exemplo n.º 2
0
        public GenericDataBaseRepository(IShopDbContext context)
        {
            Context = context
                      ?? throw new ArgumentNullException(nameof(context));

            Entities = context.Set <TEntity>();

            Entities.Load();
        }
        public GenericRepository(IShopDbContext context)
        {
            if (context == null)
            {
                throw new ArgumentException("An instance of DbContext is required to use this repository.", "context");
            }

            this.Context = context;
            this.DbSet   = this.Context.Set <T>();
        }
Exemplo n.º 4
0
        public CommandsFactory(IMovieTheaterDbContext movieDbContext, IStaffDbContext staffDbContext, IShopDbContext shopDbContext,
                               IModelsFactory factory, IExporter exporter, IFileProviderFactory fileProviderFactory)
        {
            Guard.WhenArgument(movieDbContext, DbContextCheck).IsNull().Throw();
            Guard.WhenArgument(factory, ModelsFactoryCheck).IsNull().Throw();
            Guard.WhenArgument(exporter, ExporterCheck).IsNull().Throw();
            Guard.WhenArgument(fileProviderFactory, FileProviderFactoryCheck).IsNull().Throw();

            this.moviesDbContext     = movieDbContext;
            this.modelsFactory       = factory;
            this.staffDbContext      = staffDbContext;
            this.shopDbContext       = shopDbContext;
            this.exporter            = exporter;
            this.fileProviderFactory = fileProviderFactory;
        }
Exemplo n.º 5
0
 public UnitOfWork(
     IShopDbContext context,
     IOrdersRepository orders,
     IProductsCategoriesRepository categories,
     IProductsRepository products,
     IStagesRepository stages
     )
 {
     _context    = context;
     Orders      = orders;
     Categories  = categories;
     Products    = products;
     Stages      = stages;
     _isDisposed = false;
 }
Exemplo n.º 6
0
        private void Dispose(bool isDisposing)
        {
            if (_isDisposed)
            {
                return;
            }

            if (isDisposing)
            {
                Orders     = null;
                Categories = null;
                Products   = null;
                Stages     = null;
            }

            _context.Dispose();
            _context    = null;
            _isDisposed = true;
        }
Exemplo n.º 7
0
 public OrdersRepository(IShopDbContext context)
     : base(context)
 {
 }
Exemplo n.º 8
0
 public CreateVendorCommandHandler(IShopDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
 public ProductCategoriesRepository(IShopDbContext context)
     : base(context)
 {
 }
Exemplo n.º 10
0
 public ProductsRepository(IShopDbContext context)
     : base(context)
 {
 }
Exemplo n.º 11
0
 public GetProductsByCategoryQueryHandler(IShopDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 12
0
 public ProductOperations(ShopDbContext shopContext)
 {
     DatabaseContext = shopContext;
 }
Exemplo n.º 13
0
 public GetVendorByIdQueryHandler(IShopDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
 public GetAllCategoriesQueryHandler(IShopDbContext dbContext, ICacheService cacheService)
 {
     _dbContext    = dbContext;
     _cacheService = cacheService;
 }
Exemplo n.º 15
0
 public GetAllVendorsQueryHandler(IShopDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
Exemplo n.º 16
0
 public RepositoryBase(IShopDbContext context, IMapper mapper)
 {
     this._shopDbContext = context;
     this.Set            = this._shopDbContext.Set <TDataEntity>();
     this.Mapper         = mapper;
 }
Exemplo n.º 17
0
 public OrderRepository(IShopDbContext dbContext,
                        ICacheService cacheService)
 {
     _dbContext    = dbContext;
     _cacheService = cacheService;
 }
Exemplo n.º 18
0
 public StagesRepository(IShopDbContext context)
     : base(context)
 {
 }
Exemplo n.º 19
0
 public GetFeaturedProductsQueryHandler(IShopDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 20
0
 public CreateShopCommand(IShopDbContext dbContext, IModelsFactory modelsFactory) : base(dbContext, modelsFactory)
 {
 }
Exemplo n.º 21
0
 public DeleteProductCommandHandler(IShopDbContext dbContext)
 {
     _dbContext = dbContext;
 }
 public GetAllProductsQueryHandler(IShopDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
Exemplo n.º 23
0
 public PostProvider(IShopDbContext shopDbContext, IMapper mapper)
 {
     _mapper        = mapper;
     _shopDbContext = shopDbContext;
 }
Exemplo n.º 24
0
 public UpdateProductCommandHandler(IShopDbContext dbContext,
                                    IUploadImageService imageService)
 {
     _dbContext    = dbContext;
     _imageService = imageService;
 }
Exemplo n.º 25
0
 public GetProductByIdQueryHandler(IShopDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 26
0
 public BaseRepositoryEF(IShopDbContext dbContext)
 {
     _dbContext = dbContext;
 }