Exemple #1
0
 public bool UpdateAdd(Ad ad)
 {
     _context.Entry(ad).State = EntityState.Modified;
     try
     {
         _context.SaveChanges();
     }
     catch (DbUpdateConcurrencyException ex)
     {
         throw ex;
     }
     return(true);
 }
        public async Task <User> SaveUser(User user)
        {
            _dbcontext.Entry(user).State = EntityState.Modified;

            try
            {
                await _dbcontext.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException ex)
            {
                throw ex;
            }

            return(user);
        }