views:

875

answers:

2

Hi folks,

I am pretty new to VB.NET - and I'm struggling to convert the signature of the method in the following code snippet. The Expression<...>> bit.

Thanks in advance.

 [QueryInterceptor("Orders")]
 public Expression<Func<Orders,bool>> OnQueryOrders()
 {
     return o => o.Customer.ContactName == 
         HttpContext.Current.User.Identity.Name          
 }
+3  A: 
Public Function OnQueryOrders() As Expression(Of Func(Of Orders, Boolean))
Lou Franco
A: 

Thanks Lou. I had tried that - and it didn't work and gave up too soon on that syntax. But your answer is spot on. What I hadn't realised/forgotten was that Expression needed System.Linq.Expressions. Whoops.

Eric Nelson