Results 1 to 2 of 2

Thread: [RESOLVED] Vb.net ForEach Lambda expression in C#

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    12

    Resolved [RESOLVED] Vb.net ForEach Lambda expression in C#

    Hello,

    I need help to convert this vb.net ForEach Lambda Expression in C#.

    Code:
    Public params As New List(Of SqlParameter)
    params.ForEach(Sub(p) cmd.Parameters.Add(p))
    Thanks in advance.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Vb.net ForEach Lambda expression in C#

    csharp Code:
    1. public List<SqlParameter> params = new List<SqlParameter>();
    2.  
    3. params.ForEach(p => cmd.Parameters.Add(p));

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width