public void Save(MasterDFA_Category masterDFA_Category, bool IsUpdate) { if (!IsUpdate) { _context.MasterDFA_Category.Add(masterDFA_Category); } else { _context.MasterDFA_Category.Update(masterDFA_Category); } _context.SaveChanges(); }
/// <summary> /// Saves the changes to the database. /// </summary> /// <returns>Number of rows affected.</returns> public int SaveChanges() { int recordsAffected = context.SaveChanges(); //this.Dispose(); // uncommented by kundan for memeory release return(recordsAffected); }
public OrganizationDatabaseDetail SaveOrganizationDatabaseDetail(OrganizationDatabaseDetail organizationDatabaseDetail) { try { _context.Add(organizationDatabaseDetail); var result = _context.SaveChanges(); if (result > 0) { return(organizationDatabaseDetail); } else { return(null); } } catch (System.Exception) { return(null); } }
public MasterCheckListCategory AddUpdateMasterChecklistCategory(MasterCheckListCategory checkListCategory) { string isSuccess = ""; try { if (checkListCategory.CheckListCategoryID > 0) { _context.MasterCheckListCategory.Update(checkListCategory); } else { _context.MasterCheckListCategory.Add(checkListCategory); } _context.SaveChanges(); } catch (Exception ex) { throw; } return(checkListCategory); }