简体   繁体   English

c#.net到vb.net:List(of…).find

[英]c#.net to vb.net: List(of …) .find

Can someone please translate the following C#.NET to VB.NET for me, as I'm really confused, and google isn't much help. 有人可以帮我将以下C#.NET转换为VB.NET,因为我真的很困惑,而google并没有太大帮助。 Normally I would just do a for each loop. 通常我只为每个循环做一个。

Public void removeEval(string id)
{
    evals.Remove(evals.Find(e => e.Id.Equals(id)));
}

I got the code from http://channel9.msdn.com/shows/Endpoint/Endpoint-Screencasts-Creating-Your-First-WCF-Service/ and I'm trying to make sense of it in VB.NET. 我从http://channel9.msdn.com/shows/Endpoint/Endpoint-Screencasts-Creating-Your-First-WCF-Service/获得了代码,我正在尝试在VB.NET中理解它。

那是一个lambda表达式

evals.Remove(evals.Find(Function(e) e.Id.Equals(id)))

google gave me this http://www.developerfusion.com/tools/convert/csharp-to-vb/ 谷歌给了我这个http://www.developerfusion.com/tools/convert/csharp-to-vb/

which translates this function to: 将此功能转换为:

Public Sub removeEval(id As String)
    evals.Remove(evals.Find(Function(e) e.Id.Equals(id)))
End Sub

after I corrected this: evals.Find(e => e.Id.Equals(id))); 在我纠正此问题之后: evals.Find(e => e.Id.Equals(id)));

 Public Sub RemoveEvals(ByVal id As String)
       evals.Remove(evals.Find(Function(e) e.Id.Equals(id)))
 End Sub

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM