public bool Add(Employee item) { var IsAdded = false; try { _dbContext.Employees.Add(item); IsAdded = _dbContext.SaveChanges() > 0; } catch (Exception ex) { throw new ProjectManagerException("error adding data" + ex); } return(IsAdded); }
public bool Add(TaskN obj) { try { if (obj != null) { objContext.Tasks.Add(obj); return(objContext.SaveChanges() > 0); } else { throw new ProjectManagerException("No Project to add"); } } catch (ProjectManagerException e) { throw e; } }