How to make a method generic when "type 'T' must be a reference type"? [duplicate]

Solution 1:

You could try adding the constraint class:

where T : class, ISearchableEntity

Solution 2:

Here's the full list of constraints you can use on T

http://msdn.microsoft.com/en-us/library/d5x73970.aspx