Having data annotations automatically added to properties
Posted: Thu 13 Jun 2013 18:34
I'm dumb. There, I said it. I can't find the setting to have data annotation attributes added to my object properties when updating my model from the database. I have two projects in my solution, both with a model within them. For a test, I added a new table to each database called TestTable, with a property called "Name". The model in project A does create the following attributes on the properties:
The model in project B does not...
I know this has got to be something simple. But I have the System.ComponentModel.DataAnnotations v4.0.0 added to each model's attributes list.
What am I missing?
Thx for the help. I know I'm going to feel stupid when you tell me
.
Code: Select all
[EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
[DataMemberAttribute()]
[System.ComponentModel.DataAnnotations.Key]
[System.ComponentModel.DataAnnotations.StringLength(50)]
[System.ComponentModel.DataAnnotations.Required()]
public string Name
Code: Select all
[EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
[DataMemberAttribute()]
public string Name
What am I missing?
Thx for the help. I know I'm going to feel stupid when you tell me
