Example #1
0
        // Authenticate

        public async Task <IEnumerable <AccessibleCompany> > GetAccessibleCompaniesAsync(string email, string password)
        {
            var result = await _httpClient.PostAsync <userauthentication, accessiblecompanies>("/access/authenticate", new userauthentication()
            {
                email    = email,
                password = password
            });

            return(TransformLists.TransformListResult(result, x => x.accessiblecompany, AccessibleCompany.FromNative));
        }
Example #2
0
        public static async Task <IEnumerable <TItem> > GetListAsync <TResult, TNativeItem, TItem>(this IPeaApiHttpClient httpClient, string url, Func <TResult, IEnumerable <TNativeItem> > getValue, Func <TNativeItem, TItem> transformItem)
        {
            var result = await httpClient.GetAsync <TResult>(url);

            return(TransformLists.TransformListResult(result, getValue, transformItem));
        }