The language doesn't support 'oring' together interfaces/classes in the where
clause.
You need will need to state them separately with different method names so the signatures are different.
public interface IJobHelper
{
List<T> FilterwithinOrg<T>(IEnumerable<T> entities)
where T : IFilterable
List<T> SemiFilterwithinOrg<T>(IEnumerable<T> entities)
where T : ISemiFilterable
}
Alternatively you can implement a common interface on both interfaces. This is not the same thing as above though as it may require a cast when you receive the object back if you need a specific interface that isn't contained within IBaseFilterable
.
public interface IBaseFilterable { }
public interface IFilterable : IBaseFilterable { }
public interface ISemiFilterable : IBaseFilterable { }
public interface IJobHelper
{
List<T> FilterwithinOrg<T>(IEnumerable<T> entities)
where T : IBaseFilterable
}
I don't know the context but the above is probably what you're looking for.