Skip to content

For strongly typed models, the model type must be accessible #153

@angelaki

Description

@angelaki

I'm using RazorEngineCore in an environment with some lazy loaded modules - where RazorEngineCore is one. If I now try to compile a strongly typed model (https://github.com/adoconnection/RazorEngineCore/wiki/Strongly-typed-model) with a type argument that is only accessible within my project (e.g. internal record TestModel(string Name);) the compiler throws an RazorEngineCore.RazorEngineCompilationException.

If this is by design, I don't mind. Just want to make sure, since I'm using private, class-scope based models.

Just out of curiosity: are there any speed advantages (or any others I'm missing) of using strongly typed templates? Since I'm abstracting the implementation by an interface (similar to https://bakson.dev/2022/11/10/razor-engine-core.html IRazorService) I'm asking myself if I even have any advantages by strongly typing the templates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions