예제 #1
0
 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));
 }
예제 #2
0
 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
     });
 }