scriptsharp
scriptsharp copied to clipboard
Wrong notation while converting properties in c# to Javascript function
I have a property like public string PROD_SIMP_LIST in my C# class. The javascript is generated as below get_proD_SIMP_LIST() and set_proD_SIMP_LIST().
C# Code
public string PROD_SIMP_LIST { get {} set {} }
Javascript
get_proD_SIMP_LIST: function entity$get_proD_SIMP_LIST() {}
set_proD_SIMP_LIST: function entity$set_proD_SIMP_LIST() {}
What should all caps properties be generated as when camel-casing happens? Remain all caps?
I think it should leave it as all upper case, because if I define my property in all lower case the generated output is all lower case. To be frank I don't have any personal preference, but it shouldn't be like how it is now.
Could I add on to this and request that the [PreserveCase] attribute be allowed at the class level? Or even better at the assembly level?
+1 on the PreserveCase attribute working at the assembly level. It would go a long way towards preventing mismatched names, which chews up a lot of time.
Cheers, Daniel
+1 on both PreseveCase per class and per assembly, both cases are usefull. But if I was asked to choose, I would prefere the class level.
+1 on [PreserveCase] on class level because reading JSON Serialized POCO Objects by JavaScriptSerializer is currently a pain to map into existing JS Objects sharing the same Properties.