public async Task <TKey> Insert(TEntity entity) { if (entity == null) { throw new ArgumentNullException("entity"); } string ip = string.Empty; entity.IsDeleted = false; entity.CreatedOn = DateTime.UtcNow; entity.LastModifiedOn = DateTime.UtcNow; //entity.LastModifiedBy = GetUserId(out ip); //entity.CreatedBy = GetUserId(out ip); entity.UpdatedIp = ip; Context.Entry(entity).State = EntityState.Added; await Context.SaveChangesAsync(); return(entity.Id); }