I want to define a primary key for a POCO entity but i dont want to decorate the entity with primary key attribute i wanna define that from the context class which extend DbContext
i know i should use something like:
Entity<Order>().HasKey(x => x.OrderId);
but i dont know how to do that in my context class.
any help?
In you
DbContext-class you can overrideOnModelCreatinglike this