private static Result <Entities.Product> UpdateProduct(Product productModel, Entities.Product product) { return(product.Update(productModel.Name, productModel.Description, productModel.Price, productModel.Quantity, productModel.ExpiryDate, productModel.Availability) .Map(() => product)); }
public static Product ToModel(this Entities.Product product) { return(new Product { Id = product.Id, Name = product.Name, Quantity = product.Quantity, ExpiryDate = product.ExpiryDate, Description = product.Description, Availability = product.Availability, Price = product.Price }); }