Skip to content

Precompiling models and missing usings #25812

Closed as not planned
Closed as not planned

Description

Hey everyone,

I'm attempting to generate precompiled models with:

optimize-DbContext -Context AppDbContext -OutputDir EFPrecompiledModels

which is working fine in itself, but the problem I have is that the generator does not add usings if my model references some stuff from other projects within the solution. I have to manually go and add these usings myself.

Is there some setting I'm missing or is this perhaps something that was not yet implemented?

Additionally, it would be nice if there was an option to mark the class extending RuntimeModel public - I have migrations & EF models in a separate project, and so if I generate models here, I have to manually add public accessor to the class so I can use it in Startup configuration.

Thanks!

Include provider and version information

EF Core version: 6.0.0-preview.7.21378.4
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET6
Operating system: Win
IDE: VS 2022

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions