Skip to content

Add a static flag in EF that will be set when code is being executed for design-time discovery - #28508

Merged
ajcvickers merged 3 commits into
mainfrom
StopLookAndListen0725
Jul 28, 2022
Merged

Add a static flag in EF that will be set when code is being executed for design-time discovery#28508
ajcvickers merged 3 commits into
mainfrom
StopLookAndListen0725

Conversation

@ajcvickers

Copy link
Copy Markdown
Contributor

Fixes #27306.

@ajcvickers
ajcvickers requested a review from bricelam July 25, 2022 15:09
@ajcvickers

Copy link
Copy Markdown
Contributor Author

@bricelam Is there a better way to test this?

@bricelam bricelam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also set it in DbContextActivator.CreateInstance.

Comment thread src/EFCore.Design/Design/OperationExecutor.cs Outdated
@bricelam

Copy link
Copy Markdown
Contributor

Is there a better way to test this?

This is exactly how I'd do it.

@ajcvickers
ajcvickers force-pushed the StopLookAndListen0725 branch from 3920690 to fae4e6e Compare July 26, 2022 10:54
@ajcvickers
ajcvickers requested a review from bricelam July 26, 2022 10:55
@ajcvickers

Copy link
Copy Markdown
Contributor Author

@bricelam New version up.

@bricelam bricelam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also set it in DbContextActivator.CreateInstance. That's is what ASP.NET Scaffolding uses at design-time.

@ajcvickers
ajcvickers force-pushed the StopLookAndListen0725 branch from fae4e6e to f55557b Compare July 28, 2022 13:47
@ajcvickers
ajcvickers requested a review from bricelam July 28, 2022 13:47
@ajcvickers
ajcvickers merged commit 56bfe7c into main Jul 28, 2022
@ajcvickers
ajcvickers deleted the StopLookAndListen0725 branch July 28, 2022 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a static flag in EF that will be set when code is being executed for design-time discovery

2 participants