Entity Framework 6 Refresher: Many To Many Referencing Self
1 minute read
Occasionally a many-to-many relationship needs to be established with an entity pointing to itself; In the case of the small domain we are working with, we can examine this with the concept of a Family - Person referencing Person.
In this case, we are going to need mapping information as the default migration built for this makes each person belong to one, and only one family (we’re doing a learning exercise here, ok?)
A mapping that you might think would work will cause an error The navigation property 'Family' declared on type 'LearnMappings.Person' cannot be the inverse of itself.
In this case we need to leave WithMany empty. We also need to setup the Map information as the defaults will be kind of funky (PersonPerson with columns called Person_PersonId1 and Person_PersonId)
Coming from a background with string static type checking, I am often very happy with the loseness of JavaScript. Working with this TypeScript interface, an...
While building Aurelia applications, I have occassionaly made changes that cause the gulp build process to crash. It is very easy to add console logging to ...
Leave a Comment