Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a bug for deserializing List<T>or IEnumerable<T> when using httpResponse.Content.ReadAsAsync<List<T> function #8

Open
zfkingth opened this issue Sep 4, 2016 · 0 comments

Comments

@zfkingth
Copy link

zfkingth commented Sep 4, 2016

should CanReadTypeCore function change as follow:

    private static bool CanReadTypeCore(Type type)
    {
        bool isCan = type.GetCustomAttributes(typeof(ProtoContractAttribute)).Any();

        if (!isCan && typeof(IEnumerable).IsAssignableFrom(type))
        {
            var temp = type.GetGenericArguments().FirstOrDefault();
            isCan = temp.GetCustomAttributes(typeof(ProtoContractAttribute)).Any();
        }

        return isCan;
    }
@zfkingth zfkingth changed the title There is a bug for deserializing for List<T>or IEnumerable<T> when using response.Content.ReadAsAsync<List<T> function There is a bug for deserializing List<T>or IEnumerable<T> when using httpResponse.Content.ReadAsAsync<List<T> function Sep 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant