Validate entry length based on database-first entity model

asp.net c# ef-database-first entity-framework-6 webforms

Question

Webforms, EF6.0 database-first, and C# are all used by my client. In an aspx form, I want to validate the maximum length of a textbox entry. The maximum length should be retrieved from the EF6.0 entity model to match the length of the underlying database-first field rather than being hardcoded either client-side or server-side. It's a nvarchar field (40). (If I were working in a "code-first" scenario, I might attempt utilizing validation annotations, but in a "database-first" context, this doesn't seem practical.)

How can I perform validation depending on the length of the database-first underlying field?

1
1
7/7/2015 6:07:10 PM

Popular Answer

ZZZ_tmp
0
7/10/2015 12:26:50 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow