public CreateProductCommandValidator(IOnlineStoreDbContext context) { RuleFor(x => x.NewProduct.Name) .NotEmpty() .MustAsync(async(productName, cancellation) => { var existingProduct = await context.Products.FirstOrDefaultAsync((x => x.ProductName == productName)); return(existingProduct == null); }).WithMessage("Please specify an unique name"); RuleFor(x => x.NewProduct.Price).NotEmpty().GreaterThan(0).WithMessage("Please specify an valid value for price");; }
public OnlineStoreData(IOnlineStoreDbContext context) { this.context = context; Database.SetInitializer(new MigrateDatabaseToLatestVersion<OnlineStoreDbContext, Configuration>()); }
public SampleDataSeeder(IOnlineStoreDbContext context) { _context = context; }
public DeletableEntityRepository(IOnlineStoreDbContext context) : base(context) { }
public CommentRepository(IOnlineStoreDbContext context) : base(context) { }
public ProductsRepository(IOnlineStoreDbContext context) : base(context) { }
public GenericRepository(IOnlineStoreDbContext context) { this.Context = context; this.DbSet = this.Context.Set <T>(); }
public LabelRepository(IOnlineStoreDbContext context) : base(context) { }
public UserRepository(IOnlineStoreDbContext context) : base(context) { }
public GetProductDetailQueryHandler(IOnlineStoreDbContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public SeedSampleDataCommandHandler(IOnlineStoreDbContext context) { _context = context; }
public CreateProductCommandHandler(IOnlineStoreDbContext context) { _context = context; }
public RatingRepository(IOnlineStoreDbContext context) : base(context) { }