Hi
Is it possible to have a setting to auto set the MaxLength facet of the table field (namely string type) on creation of the entity when creation is from an existing database. I see the option is there to set the property field by field for each table manually but on a large schema that is constantly evolving this is very time consuming.
I use the following code to get this value from the entity model...
ObjectStateEntry os = Entity.ObjectStateManager.GetObjectStateEntry(Table);
object value = os.EntitySet.ElementType.Members["Description"].TypeUsage.Facets["MaxLength"].Value;
I am looking to use this functionality for a validation class that will auto set the max edit length of an edit control from the entity string field thats assigned to it.
Thank you
Stephen
Auto set field MaxLength facet on creation
-
- Posts: 10
- Joined: Mon 18 Jan 2010 10:48
- Location: Devon, UK