I am fairly new to the Entity Framework and am in the process of building my first MVC application. I'm implementing a Create View for a simple Entity however, I am having problems with the (SQL Express 2005) Identity column primary key. As I understand it the Framework should handle the Identity column and let the SQL database generate the ID value.
When I try to Save using the Create View without setting the ID value I get a "Value is Required" error. If I specify any value for ID it saves back to the database using the Identity value from the database - ie. rather than the value I have specified so the T-SQL is obviously being generated correctly once it gets that far.
The Identity property is set on the ID column in the database and the StoreGeneratedPattern is set to "Identity" in the model (see below):-
Property Name="ID" Type="int" Nullable="false" StoreGeneratedPattern="Identity"
Am I missing something? How do I tell the Model that a value is not required for this column?