public ProductQuantityViewModel GetQuantities(int productId, int colorId, int sizeId, int perfumeId) { var query = _productQuantityRepository. FindSingle(x => x.ProductId == productId && x.ColorId == colorId && x.SizeId == sizeId && x.PerfumeId == perfumeId); return(Mapper.Map <ProductQuantity, ProductQuantityViewModel>(query)); }
public bool CheckAvailability(int productId, int size, int color) { var quantity = _productQuantityRepository.FindSingle(x => x.ColorId == color && x.SizeId == size && x.ProductId == productId); if (quantity == null) { return(false); } return(quantity.Quantity > 0); }
public bool CheckAvailability(int productId, int productCondition) { var quantity = _productQuantityRepository.FindSingle(x => x.ProductConditionId == productCondition && x.ProductId == productId); if (quantity == null) { return(false); } return(quantity.Quantity > 0); }