public IActionResult Search(string search) { var model = new ProductListModels() { Products = _productService.GetSearch(search) }; return(View(model)); }
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 }); }