- Entity Framework Versions
- Entity Framework Connection String
- Datacontract Serialization
- Entity Framework Data Contract Serialization
Entity Framework Connection String
Re: DataAnnotations with EntityFramework (Database First) method
Aug 24, 2011 04:29 PM|wsyeager36|LINK
Alan, I've already viewed that article. It is not set up for the Database First method. It is set up for Code First. The way I have my Model class set up is supposed to be the way to set it up using EntityFramewowrk with the DataBase First methodology. Take a look at the previous post to see how the class is set up.
Additionally, the content in there is outdated as far as the DLLs go. Check the DLLs I'm using in the above post.
The bottom line is this....
My data model for the Email field specifies the following:
[Required]
[StringLength(50)]
[DataType(DataType.EmailAddress)]
The ModelState.Count parameter is correct and the ModelState.Keys are correct along with their respective values that I am checking during debugging in the collection. It's not setting the ModelState.IsValid property to FALSE based on the above directives.
Datacontract Serialization
The Model directives above are not being triggered on the front end for validation.
It's amazing how I can't get a simple direct answer of how to use DataAnnotations using the DataBase First methodology...
Entity Framework Data Contract Serialization
How can this be resolved?