public FacebookPageDto GetPage(int id) { var entity = _socialAccountService.FindAccount(id, SocialUserSource.Facebook); if (entity == null) { throw SocialExceptions.FacebookPageNotExists(id); } return(Mapper.Map <FacebookPageDto>(entity)); }
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); }
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)); }