public DynamoDbTodoExample() { awsDb = CreateDynamoDbClient(); db = new PocoDynamo(awsDb); db.RegisterTable<Todo>(); db.InitSchema(); }
public static List<Poco> PutPocoItems(IPocoDynamo db, int count = 10) { db.RegisterTable<Poco>(); db.InitSchema(); var items = count.Times(i => new Poco { Id = i + 1, Title = "Name " + i + 1 }); db.PutItems(items); return items; }
protected DynamoMetadataType AssertTable(IPocoDynamo db, Type type, string hashField, string rangeField = null) { var table = db.GetTableMetadata(type); Assert.That(table.HashKey.Name, Is.EquivalentTo(hashField)); if (rangeField == null) Assert.That(table.RangeKey, Is.Null); else Assert.That(table.RangeKey.Name, Is.EquivalentTo(rangeField)); return table; }
private static Collection PutCollection(IPocoDynamo db) { db.RegisterTable<Collection>(); db.InitSchema(); var row = new Collection { Id = 1, Title = "Title 1" } .InitStrings(10.Times(i => ((char)('A' + i)).ToString()).ToArray()) .InitInts(10.Times(i => i).ToArray()); db.PutItem(row); return row; }
IUserAuthRepository CreateAuthRepo(IPocoDynamo db) { var authRepo = new DynamoDbAuthRepository(db); authRepo.InitSchema(); return authRepo; }
private static Customer CreateCustomer(IPocoDynamo db) { var types = new List<Type>() .Add<Customer>() .Add<Order>(); db.RegisterTables(types); db.InitSchema(); var customer = new Customer { Name = "Customer #1", PrimaryAddress = new CustomerAddress { AddressLine1 = "Line 1", City = "Darwin", State = "NT", Country = "AU", } }; db.PutItem(customer); return customer; }
private IUserAuthRepository CreateAuthRepo(IPocoDynamo db) { var authRepo = new DynamoDbAuthRepository<CustomUserAuth, CustomUserAuthDetails>(db); authRepo.InitSchema(); return authRepo; }
public BaseService(IAmazonDynamoDB dynamoClient, IPocoDynamo pocoDynamo) { this.dynamoClient = dynamoClient; this.pocoDynamo = pocoDynamo; }
public DynamoInitializer(IPocoDynamo pocoDynamo) => _pocoDynamo = pocoDynamo;