4 ms·
* Type safety is weak, as is with JSON, but both aren't un-typed." How is type safety "weak" with an ORM? You are using strongly typed objects.
by scarface74 9y ago
* Type safety is weak, as is with JSON, but both aren't un-typed."
How is type safety "weak" with an ORM? You are using strongly typed objects.
- cmenge 9y agoYes, but they don't match the data types your SQL database supports, do they? You're talking to a remote service here., i.e. varchar, decimal, datetime, etc. in SQL aren't the same as in whatever language you're using. That's true for JSON as well, but you probably need JSON on the other side (the API) as well...
- scarface74 9y agoYes. When you use Entity Franework's generator to map from a database table to a class, it not only maps the types from the database to your class, it also maps constraints like charactr length, nullable fields vs. non nullable fields, etc. The same for Mongo if you are using the C# driver. If you get a Mongo collection using the standard C# syntax -- var collection = database.GetCollection<Users>("Users"); You will work with a strongly typed "schema". As long as you are working with the "collection" object, you will be working with strongly typed objects and doing type safe Linq queries.