public static async Task SeedData(this BaseCleanArchitectureProjectDbContext dbContext, CancellationToken cancellationToken) { await SeedRolesAsync(dbContext, cancellationToken); await SeedAdministratorUser(dbContext, cancellationToken); await dbContext.SaveChangesAsync(cancellationToken); }
public virtual async Task <T> AddAsync(T entity, CancellationToken cancellationToken = default) { await ValidateAsync(entity, cancellationToken); await _dbContext.Set <T>().AddAsync(entity, cancellationToken); await _dbContext.SaveChangesAsync(cancellationToken); return(entity); }