I have a SQL Server database. This database has a table called Item. Item has a property called \"ID\". ID is the primary key on my table. This primary key is an int with a
You must define in your mapping that id is generated in the database. The way to do this depends on the type of mapping you are using. if you are using code attributes make sure that you specify IsDbGenerated in the ColumnAttribute for the Id property (or in XML mapping). if you are using dbml file make sure that Auto Generated Value is set to true.