Call cover symbol in all languages ​​in the app

I am building a web application using Javascript (in a browser), C # and Sql Server. Is it a good idea to have a consistent naming convention in all three languages?
For Javscript, it is best to use camelCase, but in C # and Sql Server it is TitleCase.
The problem is that when Javascript consumes and sends data to the C # / Sql server, the naming conventions are incompatible. So I have to write code to match them.

for instance

In Sql, I have a table called "Foo" with the columns "Name", "EmailAddress"

In C #, I have a POCO object called "Foo" that maps to this table with the "Name", "EmailAddress" properties and provides the api endpoint for the GET, this is JSON for example, "Name": "Joe Bloggs", " EmailAddres ":" joe@test.org "}

My Javascripts makes an ajax call to GET this JSON and map it to its own JSON Object, for example, {"name": data.Name, "emailAddress": data.EmailAddress}

This comparison between column and property naming conventions seems silly to me and would not be needed if all languages ​​have just agreed on a casing convention. Is there a better approach to this?

+4
2

-, .

:

  • .
  • -, .
  • , SO, , SO.

, . , , , .

Devil Advocate, , :

- , , .

, - . , , , . , .

, , . 2 , , , . , , . , .

, , , . , (, , ) , , / , , , .

+3

, GET camelCase.

futz .

var formatters = GlobalConfiguration.Configuration.Formatters;
var jsonFormatter = formatters.JsonFormatter;
var settings = jsonFormatter.SerializerSettings;
settings.Formatting = Formatting.Indented;
settings.ContractResolver = new CamelCasePropertyNamesContractResolver();

. : http://odetocode.com/blogs/scott/archive/2013/03/25/asp-net-webapi-tip-3-camelcasing-json.aspx

+2

Source: https://habr.com/ru/post/1673440/


All Articles