public void UpdateProduct(ProductsWM webModel) { try { _productsOperations.UpdateProduct(ProductsMapping.MapToEntity(webModel)); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
public static Products MapToEntity(ProductsWM webModel) { return(new Products() { ProductID = webModel.ProductID, CategoryID = webModel.CategoryID, ProductName = webModel.ProductName, UnitPrice = webModel.UnitPrice, UnitsInStock = webModel.UnitsInStock, UnitsOnOrder = webModel.UnitsOnOrder }); }