public async Task <T> AddAsync(T entity) { entity.Created = DateTime.Now; entity.ModifiedBy = _userService.CurrentUserName(); await _dbContext.Set <T>().AddAsync(entity); await _dbContext.SaveChangesAsync(); return(entity); }