dotnet / dotnet/efcore

EFOptimizeContext: add support for partial implementations

Open
#34,988 7 comments 1 reaction 1 assignee Claimed by @AndriySvyryd View on GitHub
area-model-building customer-reported needs-design
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

I created a repo to demonstrate the problem: https://github.com/andygjp/CompiledModelsInOtherProject

One project is a console app that contains a data context. Another project is a library that contains a data context and it has the `..\App\App.csproj` property set to a console project. Both data contexts are configured the same.

The compiled model is generated as expected when I use version `9.0.0-preview.4.24205.3`, but the compiled model is not generated when I change it to `9.0.0-rc.2.24474.1`, regardless if the data context and "app" are in the same project.

I can tell if the auto-compiled model is missing when the console log contains the following message:

```txt
CoreEventId.ShadowPropertyCreated[10600] (Microsoft.EntityFrameworkCore.Model.Validation)
The property 'Post.BlogId' was created in shadow state because there are no eligible CLR members with a matching name.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.