コード例 #1
0
        public FacebookPageDto GetPage(int id)
        {
            var entity = _socialAccountService.FindAccount(id, SocialUserSource.Facebook);

            if (entity == null)
            {
                throw SocialExceptions.FacebookPageNotExists(id);
            }
            return(Mapper.Map <FacebookPageDto>(entity));
        }
コード例 #2
0
        public async Task DeletePageAsync(int id)
        {
            var entity = _socialAccountService.FindAccount(id, SocialUserSource.Facebook);

            if (entity == null)
            {
                throw SocialExceptions.FacebookPageNotExists(id);
            }

            await _socialAccountService.DeleteAsync(entity);

            await _fbClient.UnSubscribeApp(entity.SocialUser.OriginalId, entity.Token);
        }
コード例 #3
0
        public FacebookPageDto UpdatePage(int id, UpdateFacebookPageDto dto)
        {
            var socialAccount = _socialAccountService.FindAccount(id, SocialUserSource.Facebook);

            if (socialAccount == null)
            {
                throw SocialExceptions.FacebookPageNotExists(id);
            }

            socialAccount = Mapper.Map(dto, socialAccount);
            _socialAccountService.Update(socialAccount);

            return(Mapper.Map <FacebookPageDto>(socialAccount));
        }