Use these data annotation options:
[System.ComponentModel.DataAnnotations.KeyAttribute()]
[System.ComponentModel.DataAnnotations.DatabaseGenerated(System.ComponentModel.DataAnnotations.DatabaseGeneratedOption.None)]
More Related Contents:
- MVC, EF – DataContext singleton instance Per-Web-Request in Unity
- ViewBag, ViewData and TempData
- jquery.validate.unobtrusive not working with dynamic injected elements
- Proper way to use AJAX Post in jquery to pass model from strongly typed MVC3 view
- One DbContext per request in ASP.NET MVC (without IOC container)
- MVC3 Non-Sequential Indices and DefaultModelBinder
- dropdownlist set selected value in MVC3 Razor
- MVC Razor dynamic model, ‘object’ does not contain definition for ‘PropertyName’
- Application_Error not firing when customerrors = “On”
- Saving Many to Many relationship data on MVC Create view
- ASP.net MVC – Model binding excludes class fields?
- what is the function of webpages:Enabled in MVC 3 web.config
- How to set a CheckBox by default Checked in ASP.Net MVC
- Unexpected “foreach” keyword after “@” character
- The name ‘model’ does not exist in current context in MVC3
- The name ‘ViewBag’ does not exist in the current context
- Using custom VirtualPathProvider to load embedded resource Partial Views
- Default ASP.NET MVC 3 model binder doesn’t bind decimal properties
- ASP.NET MVC DropDownListFor not selecting value from model
- How to validate one field related to another’s value in ASP .NET MVC 3
- Why Two Classes, View Model and Domain Model?
- Razor If/Else conditional operator syntax [duplicate]
- Annotating properties on a model with default values
- Why can’t I combine [Authorize] and [OutputCache] attributes when using Azure cache (.NET MVC3 app)?
- Entity Framework – how do I get the columns?
- MVC 3: Add usercontrol to Razor view
- Razor comment syntax
- @Html.BeginForm Displaying “System.Web.Mvc.Html.MvcForm” on Page
- Nullable property to entity field, Entity Framework through Code First
- Accessing a Session object from Razor _Layout.cshml