I have the following in my class and need to know how to modify the DataAnnotation to make it an identity column
public class Item
{
public Int16 ItemID { get; set; }
}
The goal is to have the EF5.0 equivalant of the SQL
ItemID smallint IDENTITY(0,1) NOT NULL,
You can use DatabaseGenerated attribute with DatabaseGeneratedOption.Identity. You can find more details about configuring EF with attributes here http://msdn.microsoft.com/en-us/data/jj591583 and about DatabaseGnerationOption enum here:
http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.schema.databasegeneratedoption.aspx. You can also configure your model with Fluent API – here are some examples http://msdn.microsoft.com/en-us/data/jj591617