I have a Code First EF class like so:
public class Event
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int ID { get; set; }
/* snip */
}
and what I want to happen is when the ID property is null or 0 the database will generate an ID value for it, however if I explicitly set this value so newEvent.ID=10000000, it will use that as the ID column, currently doing that will result in the next available ID.