Fredrick Lackey - 451 - Apr 22, 2014

Demis, have you ever considered adding a RangeAttribute or similar?  Something that would allow SS to determine the min and max values of a field (date, int, etc.)?  This could allow for data validation during create and update operations.  It could also allow for improved decision making when the table is being created.  For example, in Sql Server, if the range is 1 to 255, a tinyint column could be created instead of an int.  Similar logic could allow for a date field to be created instead of datetime.

We do have a [Range] attribute in SS.Interfaces https://github.com/ServiceStack/ServiceStack/tree/master/src/ServiceStack.Interfaces/DataAnnotations

We use [StringLength] to specify different field sizes for strings. Use C# numeric types to control what DB field is created. Not going to use an attribute to override that, you can use [CustomField] if you want to override OrmLite’s default behavior.

Fredrick Lackey:

Um… next question.  How do I delete a forum post.  :P