public SaveResult DeleteEventCost(EventCost eventCost) { SaveResult result = new SaveResult { WasSuccessful = true }; db.EventCosts.DeleteObject(eventCost); if (!SaveChanges()) { result.WasSuccessful = false; result.Message = "Error deleting EventCost"; } return result; }
public SaveResult UpdateEventCost(EventCost eventCost) { SaveResult result = new SaveResult { WasSuccessful = true }; db.EventCosts.Attach(eventCost); db.ObjectStateManager.ChangeObjectState(eventCost, System.Data.EntityState.Modified); if (!SaveChanges()) { result.WasSuccessful = false; result.Message = "Error updating EventCost"; } return result; }
public EventCost CreateEventCost(EventCost eventCost) { db.EventCosts.AddObject(eventCost); SaveChanges(); return eventCost; }