Skip to content

Instantly share code, notes, and snippets.

@oguzhancagliyan
Created September 30, 2020 00:20
Show Gist options
  • Save oguzhancagliyan/f501cf67071b500b43b375d1025fe4f2 to your computer and use it in GitHub Desktop.
Save oguzhancagliyan/f501cf67071b500b43b375d1025fe4f2 to your computer and use it in GitHub Desktop.
public class MovieRepository : Repository<MovieEntity>, IMovieRepository
{
public MovieRepository(IDynamoDBContext context) : base(context)
{
}
public async Task<MovieEntity> GetMovieByIdAsync(Guid movieId, CancellationToken token = default)
{
DynamoDBOperationConfig operationConfig = new DynamoDBOperationConfig
{
IndexName = Constants.MoiveTableMovieIdGsi,
};
List<MovieEntity> result = await _context.QueryAsync<MovieEntity>(movieId, operationConfig)
.GetRemainingAsync(token);
return result.FirstOrDefault();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment