Ejemplo n.º 1
0
        public async Task <List <Page> > GetPagesAsync(string accessToken)
        {
            var response = await _facebookClient.GetAsync <dynamic>(accessToken, "me/accounts");

            if (response == null || response.data == null)
            {
                throw new Exception("Page not found. ");
            }

            var pages = new List <Page>();

            foreach (var pageDynamic in response.data)
            {
                Page page = _modelMapper.GetPage(pageDynamic);
                pages.Add(page);
            }

            return(pages);
        }