sql - I can't see my model classes -
i have application in mvc4 razor , entity framework database first.i have sql database . base on generated diagram (edmx) new item "ado.net entity data model".i choose database connection,my tables , program has generated diagram tables , relationships can find class must generated after each choosen table (in solution explorer .for table student database must have mapping class student in solution ).i want add validations .can tell done wrong ?
the edmx diagram has "code-behind" file. click > beside .edmx file , should see file named same .edmx ending in .designer.cs; classes defined in "entities" region in file.
having said that, should never edit contents of file. code in there generated diagram, changes lost when alter data model elsewhere. if want add validation attributes models, you'll need create partial declarations somewhere else, , attach metadata classes them. accepted answer this question shows you'll need do.
Comments
Post a Comment