API.GetUser C# (CSharp) Method

GetUser() public static method

public static GetUser ( ulong Data ) : UserData,
Data ulong
return UserData,
    public static UserData GetUser(ulong Data)
    {
        try
            {
                return _userData.First<UserData>((u) => Data == u._id);
            }
            catch
            {
                return null;
            }
    }

Usage Example

        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            int?id = e.Parameter as int?;

            if (id != null)
            {
                API api = RestService.For <API>(AppValues.BASE_URL);
                bike = await api.GetBike((int)id);

                imImage.Source     = new BitmapImage(new Uri(AppValues.IMAGE_URL + bike.Image));
                tbModel.Text       = bike.Model;
                tbDescription.Text = bike.Description;
                if (bike.StoreId != null)
                {
                    Store store = await api.GetStore((int)bike.StoreId);

                    tbLokacija.Text = "Lokacija:\n Biciklo je u prodavnici " + store.Name;
                }
                else if (bike.UserId != null)
                {
                    User user = await api.GetUser((int)bike.UserId);

                    tbLokacija.Text = "Lokacija:\n Bicklo je kod korisnika " + user.Name;
                }
            }
        }
All Usage Examples Of API::GetUser