Skip to content

thiagomaia971/DynamoDbMapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Use

Create Entity

[DynamoDBTable("YourTable")]
public class User : Entity
{
    [DynamoDBProperty("Name")]
    public string Name { get; set; }
}

Configure

services
    .AddDynamodbMapper(configuration, environment)
    .AddRepositories(typeof(User))

Repository

GetAll

Return all Users and yours SubEntities.

var users = await _repository.GetAll();

ou

var users = await _repository
                .CreateQuery()
                .ByGsi("GSI-InheritedType", "InheritedType", "User")
                .QueryAsync();

FindById

Return User and yours SubEntities.

var users = await _repository.FindById("123456");

ou

var users = await _repository
                .CreateQuery()
                .ById("123456")
                .ByEntityType(DynamoDbOperator.BeginsWith)
                .QueryAsync();