Example #1
0
 public int Upsert(Entity.Dept dept)
 {
     if (dept.Id == Guid.Empty)
     {
         dept.Id = Guid.NewGuid();
         return(_deptRepository.Add(dept));
     }
     return(_deptRepository.Update(dept));
 }
Example #2
0
        public int Update(Entity.Dept dept)
        {
            _testEntities.Entry(dept).State = EntityState.Modified;

            return(_testEntities.SaveChanges());
        }
Example #3
0
        public int Add(Entity.Dept dept)
        {
            _testEntities.Depts.Add(dept);

            return(_testEntities.SaveChanges());
        }