EF DatabaseGeneratedOption.Identity attribute does not work for ulong type
[Table( "User" )]
public class User
{
[Key]
[DatabaseGeneratedAttribute( DatabaseGeneratedOption.Identity )]
public ulong Id { get; set; }
// other columns
}
For this code, I am getting an exception:
System.Data.Entity.Edm.EdmEntityType :: EntityType "User" has no key defined. Define a key for this EntityType.
But changing the id type to int, everything works fine.
//...
[DatabaseGeneratedAttribute( DatabaseGeneratedOption.Identity )]
public int Id { get; set; }
//...
How do I get the ability to auto-create tables with an identifier having a capacity of type ulong? (obviously using ef code)
+3
source to share