Open sagarkul opened 6 years ago
Interesting! I'll take a look at this when I can. Are you following my video course, or just trying out this code yourself?
Can you paste your MyResource
definition?
I' m geeting and error using net core 2
here is my resource class
public class MyResource { public ChannelDetailResource ChannelDetail { get; set; } public string TopicName { get; set; } public string TopicDescription { get; set; } [JsonConverter(typeof(StringEnumConverter))] public MediaType MediaType { get; set; } public string ThumbnailUrl { get; set; } public string ContentUrl { get; set; } [JsonConverter(typeof(StringEnumConverter))] public List<ContentCategory> Categories { get; set; } [JsonConverter(typeof(StringEnumConverter))] public List<Disease> Diseases { get; set; } public string Source { get; set; } [JsonConverter(typeof(StringEnumConverter))] public ContentLevel Level { get; set; } public string Notes { get; set; } public string CuratedBy { get; set; } public string Language { get; set; } public double Duration { get; set; } public bool View { get; set; } public bool Like { get; set; } public bool Dislike { get; set; } }
public class MyResource : Resource
You need to make sure it inherits from Resource or you will see that error.
I have MyResource.cs contains List and List.
Here I am getting an error as follow.
System.Reflection.TargetParameterCountException: Parameter count mismatch. at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index) at CareMentor.Web.Filters.LinkRewritingFilter.RewriteLinksInNestedObjects(IEnumerable
1 objectProperties, Object obj, LinkRewriter rewriter) in C:\Web\Filters\LinkRewritingFilter.cs:line 95 at CareMentor.Web.Filters.LinkRewritingFilter.RewriteAllLinks(Object model, LinkRewriter rewriter) in C:\Web\Filters\LinkRewritingFilter.cs:line 79 at CareMentor.Web.Filters.LinkRewritingFilter.RewriteLinksInNestedObjects(IEnumerable1 objectProperties, Object obj, LinkRewriter rewriter) in C:\Web\Filters\LinkRewritingFilter.cs:line 95 at CareMentor.Web.Filters.LinkRewritingFilter.RewriteAllLinks(Object model, LinkRewriter rewriter) in C:\Web\Filters\LinkRewritingFilter.cs:line 79 at CareMentor.Web.Filters.LinkRewritingFilter.RewriteLinksInArrays(IEnumerable
1 arrayProperties, Object obj, LinkRewriter rewriter) in C:\Web\Filters\LinkRewritingFilter.cs:line 111 at CareMentor.Web.Filters.LinkRewritingFilter.RewriteAllLinks(Object model, LinkRewriter rewriter) in C:\Web\Filters\LinkRewritingFilter.cs:line 76 at CareMentor.Web.Filters.LinkRewritingFilter.