private static List <object> BuildList(Type type, int itemCount) { var result = new List <object>(); for (int i = 0; i < itemCount; i++) { result.Add(GenFu.New(type)); } return(result); }
public async Task Run() { using (_client = new DocumentClient( new Uri(_endpointUrl), _authorizationKey, new ConnectionPolicy { EnableEndpointDiscovery = false })) { await EnsureDatabaseExists(); await EnsureCollectionExists(); var repository = new UserRepository(_client, _databaseName, _collectionName); var tenantId = Guid.NewGuid().ToString(); Generator.Configure <UserDto>() .Fill(p => p.Id, _ => Guid.NewGuid().ToString()) .Fill(p => p.TenantId, tenantId) .Fill(p => p.Email).AsEmailAddress() .Fill(p => p.PartitionKey, (string)null); var users = Generator.ListOf <UserDto>(2); _logger.LogInformation(nameof(repository.GetAsync)); foreach (var userInfo in users) { await repository.CreateAsync(userInfo); var user = await repository.GetAsync(userInfo.TenantId, userInfo.Id); _logger.LogInformation("TenantId:{TenantId} Id:{UserId} Email:{Email}", user.TenantId, user.Id, user.Email); } _logger.LogInformation(nameof(repository.GetAllAsync)); foreach (var user in await repository.GetAllAsync(tenantId)) { _logger.LogInformation("TenantId:{TenantId} Id:{UserId} Email:{Email}", user.TenantId, user.Id, user.Email); } } }
public GenFuDecimalConfigurator(GenFu genfu, FillerManager fillerManager, MemberInfo propertyInfo) : base(genfu, fillerManager) { _propertyInfo = propertyInfo; }
public GenFuDefaulturator(GenFu genfu, FillerManager maggie) { _genfu = genfu; _fillerManager = maggie; }
public GenFuConfigurator(GenFu genfu, FillerManager filterManager) { _genfu = genfu; _fillerManager = filterManager; }