Exemplo n.º 1
0
        public UserEntity Update(UserEntity userEntity)
        {
            _context.User.Attach(userEntity);
            _context.Entry(userEntity).State = EntityState.Modified;
            _context.SaveChanges();

            return(userEntity);
        }
 public Task Update(Employee entity)
 {
     return(Task.Run(async() =>
     {
         var orignial = await _demoDataContext.Employees.FirstOrDefaultAsync(e => e.EmployeeId.Equals(entity.EmployeeId));
         if (orignial != null)
         {
             _demoDataContext.Entry(orignial).CurrentValues.SetValues(entity);
         }
     }));
 }