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

Adding UnderscoreMappingResolver #114

Merged
merged 1 commit into from
Dec 21, 2014
Merged

Adding UnderscoreMappingResolver #114

merged 1 commit into from
Dec 21, 2014

Conversation

abatishchev
Copy link
Contributor

No description provided.

return Regex.Replace(propertyName, "([A-Z])([A-Z][a-z])|([a-z0-9])([A-Z])", "$1$3_$2$4", RegexOptions.Compiled).ToLower();
}

public static readonly IEnumerable<MediaTypeFormatter> Formatters = new[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the purpose of this public field?

@filipw
Copy link
Member

filipw commented Dec 20, 2014

Thank you, left a comment in the code.

@abatishchev
Copy link
Contributor Author

The usual usage of this is class is like this:

await response.Content.ReadAsAsync<AuthToken>(
    new MediaTypeFormatter[]
    {
         new JsonMediaTypeFormatter()
         {
             SerializerSettings =
             {
                 ContractResolver = new UnderscoreMappingResolver()
             }
        }
    }
});

So I cached it there. But now I start thinking this actually isn't a good idea.

@abatishchev
Copy link
Contributor Author

I updated code (removed that field), also updated test.

@filipw
Copy link
Member

filipw commented Dec 21, 2014

makes sense. Thanks!

filipw added a commit that referenced this pull request Dec 21, 2014
Adding UnderscoreMappingResolver
@filipw filipw merged commit 4d4d2d3 into WebApiContrib:master Dec 21, 2014
@abatishchev
Copy link
Contributor Author

Awesome, thanks!

Any plans to push mater to nuget, please?

@filipw
Copy link
Member

filipw commented Dec 21, 2014

ping @ChrisMissal

@abatishchev
Copy link
Contributor Author

There were no new releases for more than a year. I'd bump the minor version, i.e. 0.10.0.

By the way, way not 1.0?

@panesofglass
Copy link
Member

Let's bump to 2.0. That will keep us on par with several of our other packages, as well as Web API.

@ChrisMissal
Copy link
Contributor

Ah! Sorry all, I'll get to this later today, I promise.

@abatishchev
Copy link
Contributor Author

Hey @ChrisMissal, any news, please?

@ChrisMissal
Copy link
Contributor

There are some issues with the build, CI, and NuGet packaging. I need to get with @panesofglass to see where we sit with some of the build scripts. We talked about it briefly, but we'll need to sync up again.

I'll update this issue with what's going on when we're all on the same page.

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

Successfully merging this pull request may close these issues.

4 participants