Skip to content

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

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.

Activity

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

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