public GetProductsQuery( WmTestContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public UpdateProductCommand( WmTestContext context, IMapper mapper, CreateProductValidation productValidation) { _context = context; _mapper = mapper; _productValidation = productValidation; }
public CreateProductValidation(WmTestContext context) { RuleFor(x => x.Name) .NotEmpty() .Must(name => !context.Products.Any(x => x.Name == name)) .WithMessage("Name must be unique."); RuleFor(x => x.Category) .Must(category => context.Categories.Any(x => x.Name == category)) .WithMessage("Category must exist"); RuleFor(x => x.Manufacturer) .Must(manufacturer => context.Manufacturers.Any(x => x.Name == manufacturer)) .WithMessage("Manufacturer must exist"); RuleFor(x => x.Supplier) .Must(supplier => context.Suppliers.Any(x => x.Name == supplier)) .WithMessage("Supplier must exist"); }
public GetCategoriesQuery(WmTestContext context) { _context = context; }
public GetManufacturersQuery(WmTestContext context) { _context = context; }
public ProductProfile(WmTestContext context) { _context = context; }
public GetSuppliersQuery(WmTestContext context) { _context = context; }
public DeleteProductCommand(WmTestContext context) { _context = context; }