Skip to content

How to use partial templates like a files? #122

@VladShupik

Description

@VladShupik

Good evening! I would like to share my problem.
I am using your library, and I have one issue with partial views. So, I have 2 files .cshtml - 1) Main General file with . 2) Block

with some text from model.

I implemented custom MyBaseTemplateClass with Extension for Compile method as same as you share in your documentation. I saw Intellisence for Include methods etc. But when I am calling method compile my code crushed and the reason :
---> System.Reflection.AmbiguousMatchException: Ambiguous match found."
at System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
at System.Type.GetProperty(String name, BindingFlags bindingAttr).
COMPILE
INCLUDE

Also I attached my source files, second one when I use Include method and first where I create dictionary with 1 partial view and send to compile with main template file, may be you can help me and will say where I have mistake. Thanks for your time, have a nice day! P.S Before compile I read text from .cshtml and return string of template.

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