c# - Validate entry length based on database-first entity model -


my client using c#, ef6.0 database-first, , webforms. want validate max length of textbox entry in aspx form. don't want hardcode max-length client-side or server-side, instead want retrieve ef6.0 entity model matches length of underlying database-first field. field nvarchar(40). (if working in 'code-first' scenario try using validation annotations, doesn't seem possible in 'database-first').

how can validation based on underlying database-first field length?

you can create partial classes generated pocos , apply validations there won't overwritten when regenerate: add data annotations class generated entity framework


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -