c# - How to define length of properties -
i know best practice when defining length of properties?
can utilize length?
what drop-down, radio button , check box, need define length well?
what date created, user create type properties?
or decimal or integer properties.
i planning on using fluent api in onmodelcreating function instead of using info annotations.
no, can't utilize length. each primitive type within .net has limitation on size. see msdn article reference.
also maintain in mind type of datastore utilize (sql server, mysql, oracle db etc) has own limitations in terms of underlying info types mapped ef .net primitive types. should ok long stick db's has out-of-the-box ef integration. roll-your-own integrations might want limit field sizes to the lowest degree size between csharp primitives , db info types.
as rule-of-thumb, should specify maximum field sizes when dictated business rules or requirements, or when performance issue of kind arises.
c# sql asp.net-mvc entity-framework
No comments:
Post a Comment