public ProductManagementContext GetContext() { var options = new DbContextOptionsBuilder <ProductManagementContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()) .Options; _context = new ProductManagementContext(options); return(_context); }
public static void Initialize(IServiceProvider serviceProvider) { using (var context = new ProductManagementContext(serviceProvider.GetRequiredService <DbContextOptions <ProductManagementContext> >())) { if (context.Products.Any()) { return; } var randomizer = new Random(); for (int i = 0; i < 10; i++) { context.Products.Add(new Product { Id = Guid.NewGuid(), Name = $"Test{i}", Description = $"Test{i} Product", Quantity = randomizer.Next(1, 100), Touched = DateTime.UtcNow }); Task.Delay(10); } context.SaveChanges(); } }
public GetProductByIdHandler(ProductManagementContext context, IProductMapper productMapper) { _context = context; _productMapper = productMapper; }
public UserRepository(ProductManagementContext context) { productContext = context; dbset = context.Set <Users>(); }
public ImageRepository(ProductManagementContext context) { _context = context; }
public ProductRepository(ProductManagementContext context) { this.context = context; }
public DimensionRepository(ProductManagementContext context) { _context = context; }
public CategoryQueryFacade(ProductManagementContext context) { _context = context; }
public ProductQueryFacade(ProductManagementContext context) { _context = context; }
public DimensionQueryFacade(ProductManagementContext context) { _context = context; }
public LeafCategoryRepository(ProductManagementContext context) { _context = context; }
protected Repository(ProductManagementContext context) { Context = context; DbSet = context.Set <TEntity>(); }
public ProductRepository(ProductManagementContext context, IProfitMarginService profitMarginService) : base(context) { _profitMarginService = profitMarginService; }
public SpecificationQueryFacade(ProductManagementContext context) { _context = context; }
public UpdateProductHandler(ProductManagementContext context, IProductMapper productMapper) { _context = context; _productMapper = productMapper; }
public ProductRepository(ProductManagementContext context) { productContext = context; dbset = context.Set <Products>(); }
public SpecificationRepository(ProductManagementContext context) { _context = context; }