Beispiel #1
0
        public async Task <UserInfo> FindByIdAsync(string userId, CancellationToken cancellationToken)
        {
            var record = await _dynamoDb.GetItemAsync("Users", new Dictionary <string, AttributeValue>
            {
                { "Id", new AttributeValue {
                      N = userId
                  } }
            });

            return(UserModelFactory.CreateUserInfoFromAWS(record.Item));
        }
Beispiel #2
0
        public async Task <UserInfo> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken)
        {
            var result = await _dynamoDb.QueryAsync(FindByNameQuery(normalizedUserName), cancellationToken);

            var record = result.Items.FirstOrDefault();

            if (record == null)
            {
                return(null);
            }

            return(UserModelFactory.CreateUserInfoFromAWS(record));
        }