0
itbmo created
Is it possible to create entity without Id column ? How ?
Basically we have an entity with composite key and the records are deleted and entered frequently, that means if we have identity primary key the key values will be increased drastically on frequent add/delete records. So we do not want any identity primary key for that entity, just composite key as a primary key.
3 Answer(s)
-
0
Hi,
You can ignore Id field in OnModelCreating of your dbContext. Should be soething like this:
modelBuilder.Entity<Entity>().Ignore(t => t.Propert);
Thanks.
-
0
Exactly what i was looking for, thanks for the reply and solution.
-
0
Thanks for your feedback