1

How can I set the starting value for an identity primary key when using the mvc 5 code first approach?

Recently I tried using

[DatabaseGenerated(DataGeneratedOption.Identity)] 

but this automatically starts the values off at 1 whereas I want to set my own starting value.

JLRishe
  • 99,490
  • 19
  • 131
  • 169
  • possible duplicate of [EF Code First - how to set identity seed?](http://stackoverflow.com/questions/5974554/ef-code-first-how-to-set-identity-seed) –  May 23 '14 at 10:43
  • try look here http://stackoverflow.com/questions/5701608/unique-key-with-ef-code-first/5701702#5701702 and here http://stackoverflow.com/questions/5974554/ef-code-first-how-to-set-identity-seed – Valentyn Vynogradskiy May 23 '14 at 10:44

0 Answers0