Is There any way to RESEED a LocalDB Table using EF?
I'd prefer not to use this SQL Command :
DBCC CHECKIDENT('TableName', RESEED, 0)
FYI : I'm using EF 6.1.
Thanks alot.
I assume you're trying to reset the primary key on the table? If so, no there is no way in EF to do this.
As you stated, you would have to use a SQL command such as:
context.Database.ExecuteSqlCommand("DBCC CHECKIDENT('TableName', RESEED, 0)")
But I have to ask why you're trying to do this anyway? It shouldn't matter to you what value is in your primary key field.