Invalid cast and extensions at runtime #120
Unanswered
americanslon
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Template
Compiles successfully, I also pass
Common
,Domain
,System
usingAddAssemblyByName
Running the template
LoadTemplate
is a wrapper aroundIssue 1 - Invalid cast
List<Domain.Comment.Comment> Comments = ViewBag.Comments;
seems to cause
Cannot implicitly convert type 'System.Collections.Generic.List<object>' to 'System.Collections.Generic.List<Domain.Comment.Comment>'
Issue 2 -
@(Model.Interval.GetAttribute<Common.Constants.CA.Interval.DescriptorAttribute>().Name)
seems to cause
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'Common.Constants.Session.CA.Interval.Intervals' does not contain a definition for 'GetAttribute'
GetAttribute
is an extension method on theEnum
. It's in theCommon
assembly. Here is the codeAny help would be appreciated. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions