Exemplo n.º 1
0
        public async Task DeleteAccountAsync(int id)
        {
            var entity = _socialAccountService.FindAccount(id, SocialUserSource.Twitter);

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

            await _socialAccountService.DeleteAsync(entity);
        }
Exemplo n.º 2
0
        public TwitterAccountDto GetAccount(int id)
        {
            var entity = _socialAccountService.FindAccount(id, SocialUserSource.Twitter);

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

            return(Mapper.Map <TwitterAccountDto>(entity));
        }
Exemplo n.º 3
0
        public TwitterAccountDto UpdateAccount(int id, UpdateTwitterAccountDto dto)
        {
            var socialAccount = _socialAccountService.FindAccount(id, SocialUserSource.Twitter);

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

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

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