public async Task <int> CompleteAsync(CancellationToken cancellationToken = default)
 {
     cancellationToken.ThrowIfCancellationRequested();
     return((await _extrasDbContext.SaveChangesAsync(cancellationToken)) + _diApiContext.SaveChanges());
 }
Пример #2
0
        private async Task <ActivityType[]> FakeActivityTypes(int count)
        {
            var faker = new Faker <ActivityType>()
                        .RuleFor(x => x.Name, f => f.Lorem.Word())
                        .RuleFor(x => x.IsActive, f => f.Random.Bool());

            _dbContext.ActivityTypes.AddRange(faker.Generate(count));
            await _dbContext.SaveChangesAsync();

            return(await _dbContext.ActivityTypes.ToArrayAsync());
        }
Пример #3
0
 public async Task <int> CompleteAsync(CancellationToken cancellationToken = default)
 {
     return(await _dbContext.SaveChangesAsync(cancellationToken));
 }