Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet ef dbcontext scaffold creates a property of the parent type in the child class #34169

Open
SCC-BDuncan opened this issue Jul 5, 2024 · 1 comment

Comments

@SCC-BDuncan
Copy link

Is there a way to tell ef core not to create a method of the parent type in the child?

For example. I have a Booking table with a foreign key to the BookingAddresses Table. I expect a booking class (the parent) with a property of List, which I get. The problem is that the BookingAddress class (the child) has a property of type Booking, the parent.

@ajcvickers
Copy link
Member

@SCC-BDuncan You can use custom T4 templates to change what is scaffolding. @ErikEJ's EF Core Power Tools have more options for scaffolding than the EF commands, but I'm not sure that they support this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants