Unfortunately I seem to have hit a problem with the compiler complaining when I try to use an interface as an input parameter, if that interface requires a type to be defined.
I'm not sure if I explained that at all well, but given the following example, the compiler complains that I haven't specified a type in the defintion of someMethod. I've tried putting in <T> but it still complains. It only works if I strongly type (by putting <string> in there.
//An underlying type to hold some data. public interface IDic<T>: IDictionary<string, T> { T this[string key] { get; set; } } //A higher level object which uses the underlying type plus some others. public interface IFoo<T> { IDic<T> someProperty { get; set; } } //Something that takes the object in and does something with it. public interface IBar { bool someMethod(IFoo foo); } |
I really don't want to strongly type at the IBar level and would prefer that I could genericise this somehow. Does anyone have any ideas

Generics And Interfaces....
Pete2
public interface IBar<T>
{
bool someMethod(IFoo<T> foo);
}
trc_pdx
//Something that takes the object in and does something with it.
public interface IBar
{
bool someMethod<T>(IFoo<T> foo);
}