Created
September 30, 2020 00:20
-
-
Save oguzhancagliyan/f501cf67071b500b43b375d1025fe4f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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