gimmi / extdirecthandler

Ext Direct router implementation for ASP.NET
http://gimmi.github.com/extdirecthandler/
Other
13 stars 11 forks source link

Add options for camelCase/PascalCase property and method names #10

Closed schiffm closed 12 years ago

schiffm commented 12 years ago

Currently, PascalCase method names in C# are being mapped to camelCase JavaScript method names by using a helper function, pascalizeName, in the ReflectionConfigurator. Similarly, PascalCase property names in C# objects are being mapped to camelCase property names in the returned JSON by use of the CamelCasePropertyNamesContractResolver of the Newtonsoft.Json library.

I'd like to request that there be options to change or preserve the case of properties and methods. I have a large project that was using a different Ext.Direct implementation, which did not change any cases. It would be a huge task to change the case of all properties and methods throughout the JavaScript to be able to use ExtDirectHandler.

gimmi commented 12 years ago

You can customize ALL aspects of JSON serialization by following the example in this wiki page:

https://github.com/gimmi/extdirecthandler/wiki/JSON-serialization-customization

For the naming of published methods, ExtDirectHandler support pluggable metadata provider (classes that implements IMetadata and act as provider of Action/Method definitions). Out of the box you have 2 metadata providrs:

If this is not enought, you can propose a pull request with the changes in ReflectionConfigurator that you wish integrate, and i will be appy to consider it

schiffm commented 12 years ago

This is resolved in version Version 0.8.10 through pull # 11. Thanks!