How do I convert this C# lambda expression to VB.Net? -


I am trying to change a C # lambda which I have used several times on VBnet but I do not Can be used to detect the correct syntax to detect. Here is the original C # code:

  Public override IQueryable & lt; E & gt; & Lt; E & gt; (Paramus System.links.expression.express.lt; Funk & lt; E, Object & gt; & gt; [] Expressions included) {IQueryable & lt; E & gt; Result = null; If (insert any.) (Result = include expression. Aggreate & lt; expression & lt; funk & lt; e, object & gt; & gt ;, IQueryable & lt; E & gt; & gt; Reference .set & lt; e & gt; (), (current, expression) => current.Include (expression))}} return result;}   

Used the converter and tried to rewrite the function, but I can not find anywhere when I provide the last method, the code converter output :

  The public override function [selection] (e) as the expression in the expression (in the form of expressions in expression (in the form of the function (e, of the object)) ()) IQueryable (E) results in the IQueryable form (E) = Anything that does not include expression (if any) then the result = include expression.Agregrate (function (e, object), IQueryable (E   

I believe that the culprit is () (set) (set) (e) (), function (current, expression ) Current.Include (expression)) The following:

  function (current, expression) current.Include (expression)   

I do not think the code converter (and When I tried manually, this lambda expression is formatted properly.

Here is a link to a blog post that describes the method and purpose to use, if you want more detail:

The function is not compiled in VB.Net An error gets that included Expressions. Aggregate is not the correct number of parameters in the call. I believe this is not the second argument (lambda) properly compiling and not returning its result.

I think that if you close the stern, then you should work, the compiler may possibly have lambda Does not like the return type Doing this should work you out, if you want to leave hard, I believe:

  public function [selection] (like e squared) (ParamArray includes Linux Expression as .expression Func (E, Object)) ()) IQueryable (EK) = IQueryable (EK) = result of IQueryable (E) = if nothing does not include Expression. Anyone () then results = Included Expression Aggregate (reference [set] (E) (    (function (current, expression) CType

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -