You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compile generated UnsafeAccessors classes don't match underlying class accessibility level #35013
When using EFOptimizeContext for build-time optimisation and your have an Entity which is less accessible than public the generated UnsafeAccessors class will raise inconsistent accessibility errors.
For example even if the source class is internal the generated UnsafeAccessors class will look something like this:
changed the title [-]Compile generated UnsafeAccessors classes don't match underlying class accessibility level (Microsoft.EntityFrameworkCore.Tasks 9.0.0-rc.2.24474.1)[/-][+]Compile generated UnsafeAccessors classes don't match underlying class accessibility level[/+]on Oct 29, 2024
public static class is hard-coded here and is completely unreasonable. And most places (maybe even all places) in the generator of the entire project are directly hard-coded public.
Activity
[-]Compile generated UnsafeAccessors classes don't match underlying class accessibility level (Microsoft.EntityFrameworkCore.Tasks 9.0.0-rc.2.24474.1)[/-][+]Compile generated UnsafeAccessors classes don't match underlying class accessibility level[/+]qhy040404 commentedon Aug 4, 2025
public static classis hard-coded here and is completely unreasonable. And most places (maybe even all places) in the generator of the entire project are directly hard-codedpublic.efcore/src/EFCore.Design/Scaffolding/Internal/CSharpRuntimeModelCodeGenerator.cs
Line 216 in 08f094b
Handle discriminators that use a value converter in the compiled model
Handle discriminators that use a value converter in the compiled model
Fix several small issues in the compiled model (dotnet#38441)