src/WeText.Web/Models/WebApiUserStore.cs
/// <summary>
/// Finds the application user by identifier.
/// </summary>
/// <param name="userId">The user identifier.</param>
/// <returns>A task that is responsible for finding the application user by its identifier and returns
/// the found user instance.</returns>
Finds the application user by identifier.
Finds the application user by identifier .
public async Task<ApplicationUser> FindByIdAsync(string userId)
        {
            using (var proxy = new ServiceProxy(this.baseAddress))
            {
                var result = await proxy.GetAsync(string.Format("api/accounts/id/{0}", userId));
                if (result.StatusCode == HttpStatusCode.NotFound)
                {
                    return null;
                }
                result.EnsureSuccessStatusCode();
                dynamic accounts = JsonConvert.DeserializeObject(await result.Content.ReadAsStringAsync());
                dynamic account = accounts[0];
                return new ApplicationUser
                {
                    UserName = (string)account.Name,
                    DisplayName = (string)account.DisplayName,
                    Email = (string)account.Email,
                    Id = (string)account.Id,
                    PasswordHash = (string)account.Password
                };
            }
        }
public async Task < ApplicationUser > FindByIdAsync ( string userId ) { using ( var proxy = new ServiceProxy ( this . baseAddress ) ) { var result = await proxy . GetAsync ( string . Format ( " " , userId ) ) ; if ( result . StatusCode == HttpStatusCode . NotFound ) { return null ; } result . EnsureSuccessStatusCode ( ) ; dynamic accounts = JsonConvert . DeserializeObject ( await result . Content . ReadAsStringAsync ( ) ) ; dynamic account = accounts [ 0 ] ; return new ApplicationUser { UserName = ( string ) account . Name , DisplayName = ( string ) account . DisplayName , Email = ( string ) account . Email , Id = ( string ) account . Id , PasswordHash = ( string ) account . Password } ; } }
Finds the application user by identifier.
Finds the application user by identifier .
A task that is responsible for finding the application user by its identifier and returns
the found user instance.
A task that is responsible for finding the application user by its identifier and returns the found user instance .
userId
string
The user identifier.
The user identifier .