Exemplo n.º 1
0
        public async Task <TwitterAccountApiDto> GetUserById(string id)
        {
            Guard.WhenArgument(id, "User Id").IsNullOrEmpty().Throw();

            var resourceUrl = "https://api.twitter.com/1.1/users/show.json?user_id=";
            var userJson    = await apiService.GetTwitterApiCallData(resourceUrl + id);

            Guard.WhenArgument(userJson, "Json Response").IsNullOrEmpty().Throw();

            var deserializedUser = jsonDeserializerWrapper.Deserialize <TwitterAccountApiDto>(userJson);

            Guard.WhenArgument(deserializedUser, "Deserialized User").IsNull().Throw();

            return(deserializedUser);
        }