public virtual async Task <int> CreateAsync(TEntity model) { if (model == null) { throw new ArgumentNullException(string.Format(ErrorDetails.EntityCannotBeNull, nameof(TEntity))); } await dbContext.Set <TEntity>().AddAsync(model); await dbContext.SaveChangesAsync(); return(model.Id); }
public virtual async Task <int> SaveChangesAsync() { return(await _con.SaveChangesAsync()); }