I had the following c# code:
public T Single(Expression<Func<T, bool>> where)
{
return _dbset.Single<T>(where);
}
I tried to convert this to vb.net using a conversion tool which rendered the code as follows:
Public Function [Single](where As Expression(Of Func(Of T, Boolean))) As T
Return _dbset.[Single](Of T)(where)
End Function
This is throwing an error "Overload resolution failed because no accessible 'Single' accepts this number of arguments
Any idea of how to correct this?
The compiler isn't able to bind to the right static method for some reason - possibly because it doesn't know if you want
Enumerable.SingleorQueryable.Single. You can get around it by calling the extension method statically: