Try our conversational search powered by Generative AI!

Problem deleting IContent

Vote:
 

I have a gadget that lists page comments on my site. There is also an option to delete a comment by calling Delete in IContentRepository. This has been working fine for a long time, but the other day I noticed that the delete function threw an error:

EPiServer.Core.TypeMismatchException was unhandled by user code
HResult=-2146233088
Message=Content with id '2317' is of type 'Castle.Proxies.CommentDataProxy' which does not inherit required type 'EPiServer.Core.PageData'
Source=EPiServer

Of course the content doesn't inherit PageData, it inherits IContent.

Any ideas what this might be? I'm running EPiServer 7.1.

 

 

#73005
Jul 03, 2013 18:50
Vote:
 

Not sure if I understood you correctly, but shouldn't your content (CommentData) still inherit from PageData (or BlockData, depending on if it's a page or a block) which implements the IContent interface.

#73142
Jul 08, 2013 14:05
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.