I am trying to make my own small application in VS MVC ASP.net using Entity Framework. Solution consists of class library and ASP MVC application that uses those classes. Using Entity Framework I created classes from database, including Context class, all is as EntityFramework created it, I did not edit source code.
I did this before and it always went pretty smooth. Table in database tbAttribute has "normal" columns and one identity column which is auto-increment and primary key. As I did before in my smaller test application, MVC generated View to Create new row for this table but this time, it also used ID column which should not be in Create, Detail or Update View at all! It does not let me leave this field empty as it is "required".
I did this before, and MVC never generated identity columns in Views. So, what could cause this time for that to happen? How can I configure my application to ignore ID columns automatically as before (not to use any bind exclude etc)? In short: why would MVC suddenly use identity columns in Views? Table is created by script similar to this (original script is longer):
CREATE TABLE [dbo].[tbAttribute](
[AttributeID] [int] IDENTITY(1,1) NOT NULL,
[ShortName] [nchar](50) NOT NULL,
[DisplayName] [nchar](150) NOT NULL,
CONSTRAINT [pk_Attribute] PRIMARY KEY CLUSTERED
(
[AttributeID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]