I have the following signature which has a generic type and parameter as below:
List<T> GetMyList<T>(T filter);
The filter type is different from the list type. I am trying to call like this:
var myList = repo.GetMyList<List<items>>(filter);
I am not sure how to specify the type of 'filter' in the method call. Is this possible?
repo.GetMyList(filter), and theTwill be whatever type yourfilterparameter is.Tand returns a list of typeT. There's no way around that. Maybe if you explained the problem in more detail a solution could be determined, but what you are asking is not possible with that signature.List<T> GetMyList<T>(T filter);? Meaning can you change it's signature?