Couple of options, depending on what the functionality in MoreFunctionality is:
1: Make it a generic decorator class instead of a parent class, like this:
public class MoreFunctionality<TEntities> where TEntities : ObjectContext
{
private readonly TEntities _objectContext;
public MoreFunctionality(TEntities objectContext)
{
this._objectContext = objectContext;
}
public TEntities ObjectContext
{
get { return this._objectContext; }
}
// Other behaviour
}
...and pass the decorator around instead of the ObjectContext.
2: Make it an interface and add the behaviour using extension methods, like this:
public interface IMoreFunctionality
{
}
public partial class CLMEntities : ObjectContext, IMoreFunctionality
{
}
public static class MoreFunctionalityExtensions
{
public static void SomeFunctionality(
this IMoreFunctionality moreFunctionality)
{
// Do something...
}
public static void SomeMoreFunctionality(
this IMoreFunctionality moreFunctionality)
{
// Do something else...
}
}