How to invoke UnitOfWork where and firstordefault by using reflector?

84 Views Asked by At

I tried to invoke UnitOfWork where and firstordefault by using reflector?

Normal command

Me.UnitOfWork.GetAll(Of RG.Model.Student).Where(Function(x) x.Id = 1).FirstOrDefault

But i tried to change by using reflector. This is my current code

Dim typeModel = Type.GetType("RG.Model.Student, RG.Model")
Dim method = Me.UnitOfWork.GetType().GetMethod("GetAll")
Dim generic = method.MakeGenericMethod(typeModel)
Dim retVal As Object = generic.Invoke(Me.UnitOfWork, Nothing)

How to call Where? because I tried to call getMethod after invoke, it will return Nothing.

0

There are 0 best solutions below