how to implement code changes without altering core classes

Topics: Customizing Orchard
Jun 17, 2013 at 2:10 PM
I have managed to alter ItemInspector class in Orchard.Core.Feeds.StandardBuilders in order to get a different RSS result.I have the desired functionality now, but i know that It s not the best practice to change core classes.
So what i have to do if i want to keep intact ItemInspector class in Orchard.Core but also want the new functionality?Should I create a new module just only for this slight change and what i have to include in this module?
I just want a general guideline ,not code :)
Thanx in advance!
Jun 17, 2013 at 3:56 PM
If you think the change is something that should be in core, submit a pull request.

If you think the change is something isolated to you, copy the code to another class and use the OrchardSuppressDependency attribute (
Jun 18, 2013 at 7:23 AM
Thanks for the tip Jetski5822!

I have already implemented Roland Thompson's tutorial but no results for me.
Actually I created a new module as the documentation says.
The only thing i ve added is a new folder -->StandardBuilders
Inside the new folder i have implemented MyItemInspector class that is a variation of ItemInspector in
I have also used the attribute OrchardSuppressDependency
public class MyItemInspector 
   //my code here
I ve include in the .csproj file of the module these lines
       <Compile Include="StandardBuilders\MyItemInspector.cs" />
I enabled the module but i do not have the desired result.When i m debbuging still the system calls orchard.core.feeds ItemInspector class
and not mine.
Where is my mistake?
Jun 18, 2013 at 8:44 AM
Ahhhh because OrchardSuppressDependency only suppresses stuff that goes through DI to which ItemInspector does not.

Okay, can I ask what changes you have made?
Jun 18, 2013 at 9:23 AM
the only actual change is that i altered the return string of public string Description
    return img+_htmlFilters.Aggregate(_body.Text, (text, filter) => filter.ProcessContent(text, GetFlavor(_body)));
where img is a string that i create