Try our conversational search powered by Generative AI!

Override entity type without custom entity provider?

Vote:
 

I want to replace the Entry instances with a derived class which changes the behaviour slightly. There's no custom data or anything. I could only find the old docs, like http://world.episerver.com/PageFiles/22546/A%20Programmers%20Guide%203_1_REVB.pdf. Section 3.1 in that doc describes how to replace an entity with a derived type by using a custom entity provider

I'm thinking that this plug-in system might have evolved since 3.1 or maybe there was a simpler way even back then? I really only want to intercept the creating of the Entry entity type and use my custom class. Is using a custom entity provider the only way?

#58406
Apr 24, 2012 8:28
Vote:
 

Do you need to intercept creation of the entity or just mixin some additional functionality to that entity?

What I did was to wrap that entity into my own interception class and provide strongly typed access to entity's attributes. Maybe that could help you to accomplish your requirements in similar way?

 

http://world.episerver.com/Blogs/Valdis-Iljuconoks/Dates/2012/2/Synchronize-Relate-entitys-attributes-in-a-strongly-typed-way/

#59011
May 16, 2012 8:02
Vote:
 

Thanks for your suggestion! I needed to override one of the methods in the entity, so any approach involving extension methods would not work. I did it the custom entity provider way and it worked, just thought there might be a simpler way. 

#59017
May 16, 2012 10:18
This thread is locked and should be used for reference only. Please use the Legacy add-ons 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.