I am considering using xVal to validate Entity Framework classes in an MVC application. This includes writing metadata classes detailed by Graham O'Neill ( http://goneale.com/2009/03/04/using-metadatatype-attribute-with-aspnet-mvc-xval-validation-framework ).
I am wondering if there is a way to automatically create such metadata classes using metadata from an SQL database (for example: non-empty fields will have the class attribute [Required].
You can use the Code Smith tool www.codesmithtools.com (there is a free version, if I remember correctly)
I wrote an application that will read an existing database and then generate a data annotation class for each table (excluding aspnet_ * and VersionInfo).
http://pfsolutions-mi.com/Product/MetaDataClassGenerator
In EF 4, you can easily customize code generation using the T4 template .
Source: https://habr.com/ru/post/1300749/More articles:to create a git repository for a project skeleton - gitkeyboard shortcut - jqueryCalling a variable by name that is not known at compilation - java"html agility pack" as a module for perl - htmlAdd menu item VS 2008 - visual-studio-2008NHibernate.Linq - Custom / Calculated Expression - sqliframes with jQuery - jqueryWhat approach would you use for this particular database design problem? - designHow to get Perl Spreadsheet :: WriteExcel to create formulas using VLOOKUP? - perlRunning Flip Animation Entirely Through WPF Code - animationAll Articles