public async Task <bool> MakeUserActive(int id) { try { IQueryable <User> query = context.Users; query = query.Where(u => u.UserID == id); var usr = query.First(); usr.IsActive = true; context.Update(usr); await context.SaveChangesAsync(); return(true); } catch { return(false); } }
public async Task <bool> Update <T>(T entity) where T : class { try { context.Update <T>(entity); await SaveChangesAsync(); return(true); } catch { return(false); } }