Example #1
0
        public IActionResult Search(string search)
        {
            var model = new ProductListModels()
            {
                Products = _productService.GetSearch(search)
            };

            return(View(model));
        }
Example #2
0
 public static Product MapToEntity(this ProductListModels model)
 {
     return(new Product
     {
         ProductId = model.ProductId,
         ProductName = model.ProductName,
         SupplierId = model.SupplierId,
         CategoryId = model.CategoryId,
         QuantityPerUnit = model.QuantityPerUnit,
         UnitPrice = model.UnitPrice,
         UnitsInStock = model.UnitsInStock,
         UnitsOnOrder = model.UnitsOnOrder,
         ReorderLevel = model.ReorderLevel,
         Discontinued = model.Discontinued
     });
 }