public static OperationStatus UpdateProduct(Product product) { using (var context = CreateGolfClubShackEntities()) { var prod = context.Products.Where(p => p.ProductID == product.ProductID).SingleOrDefault(); prod.ModelName = product.ModelName; prod.CategoryID = product.CategoryID; try { context.SaveChanges(); return new OperationStatus { Status = true }; } catch (Exception exp) { return new OperationStatus { Status = false, Message = exp.Message }; } } }
public OperationStatus Product(Product product) { return DAL.UpdateProduct(product); }