interface Ico
{
T Result{get ; set; }
SomeType
SomeType
}
works fine but i want that the returing type (SomeType) of the methods not to be explicitly described here, type implementing it should name itself instead of SomeType.
what i want is like this
T2
where T2 is the implementing type of the interface i don't know how to get it right
compiler won't let me specify like this
i tried
interface Ico
but that does not work either.
Is it even possible in c#
Thanks
Regards
VulpesPosted Jul 10, 2013, 7:03 PM
Firstly, there's no way to constrain a type parameter so that it can only refer to a generic type which rules out stuff such as T2
Secondly, you can't constrain a type parameter in an interface to only refer to its implementing type.
Also, the fact that the Call method is itself generic makes it difficult to come up with anything that's even close.
RightthenPosted Jul 11, 2013, 12:23 AM
Thanks for the input.
Thanks
Regards