-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use partial templates like a files? #122
Comments
@adoconnection, I found how to solve the problem that I wrote earlier. If we are used some classes with inheritance and classes have the same names of properties engine compile crushed. You have AnonymousTypeWrapper and method TryGetMember, on 24 line all broke with exception : "Ambiguous match found". So also I found link with the same problem. GetProperty reflection results(https://stackoverflow.com/questions/11443707/getproperty-reflection-results-in-ambiguous-match-found-on-new-property). This is idea how can fix it -> PropertyInfo property = this.model.GetType().GetProperties().First(p => p.Name == binder.Name); |
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
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).
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.
The text was updated successfully, but these errors were encountered: