コード例 #1
0
        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);
        }
コード例 #2
0
 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;
     }
 }