Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7420455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:14:31+00:00 2026-05-29T08:14:31+00:00

Working with an API where I need to send a value over in an

  • 0

Working with an API where I need to send a value over in an array of NVPairs, like the following:

new[]
{
    new[]
    {
        new NVPair
        {
            name = "email_address",
            value = "email1@email.com"
        }
    },
    new[]
    {
        new NVPair
        {
            name = "email_address",
            value = "email2@email.com"
        }
     }
}

I need to be able to create this (the value, or “email2@email.com”) from a list of strings (that will be the email addresses).

Would anyone be able to provide some guidance?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T08:14:32+00:00Added an answer on May 29, 2026 at 8:14 am

    Assuming you really want an array of single-element arrays, I suspect you want:

    var nvPairs = strings.Select(x => new[] { new NVPair("email_address", x) })
                         .ToArray();
    

    This is also assuming that the NVPair type in question has a two-parameter constructor, taking the name and the value. If it doesn’t, the query becomes uglier:

    var nvPairs = strings.Select(x => new[] { new NVPair { name = "email_address",
                                                           value = x } })
                         .ToArray();
    

    Note the new[] so that each element is transformed into a single-element array.

    Another option which would at least work from a compile-time point of view is to create a single-element outer array, where its sole element was a multi-element array:

    var nvPairs = new[] { strings.Select(x => new NVPair("email_address", x))
                                 .ToArray() };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

New to programming and Ruby. I'm working with the iStock API and need to
Im currently working with an API which requires we send our collection details in
I've been working with the SpiderMonkey C API and would like to implement a
UPDATE: I managed to get this thing working! Turns out, you NEED to send
I'm working on a project and I need to create an API. I am
I am currently working on the HTML5 File API, and I need to get
I'm working on a voting app where I need to send an email to
I'm working with SimpleGeo API and I need to get place's latitude/longitude by ZIP
I'm working on a Zend Framework API and need to follow a particular format
I am working on Java Mail API and i need to develop a general

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.