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 8614917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:14:28+00:00 2026-06-12T05:14:28+00:00

In my MVC3 application I want to create an anonymous collection with fields names

  • 0

In my MVC3 application I want to create an anonymous collection with fields names like this:

new 
{                                                                            
   Buyer.Firstname = "Jim",
   Buyer.Lastname = "Carrey",
   Phone = "403-222-6487",
   PhoneExtension = "",
   SmsNumber = "",
   Buyer.Company = "Company 10025",
   Buyer.ZipCode = "90210",
   Buyer.City = "Beverly Hills",
   Buyer.State = "CA",
   Buyer.Address1 = "Address 10025"
   Licenses[0].IsDeleted = "False",
   Licenses[0].ID = "6",
   Licenses[0].AdmissionDate = "2,1999",
   Licenses[0].AdmissionDate_monthSelected = "2",                                                                           

                                                                    } 

I want to have this in order to send custom post requests during integration testing of my app. How can I declare a an anonymous collection with this field names?

  • 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-06-12T05:14:29+00:00Added an answer on June 12, 2026 at 5:14 am

    Use an anonymous collection of anonymous objects, like so:

    Licenses = new [] {
        new {
            IsDeleted = "False",
            ID = "6",
            AdmissionDate = "2,1999",
            AdmissionDate_monthSelected = "2"
        } //, ... and so on
    }
    

    … and in context: ([edit] Oh, and I didn’t see your buyer…)

    new 
    {    
        Buyer = new {
            Firstname = "Jim",
            Lastname = "Carrey",
            Company = "Company 10025",
            ZipCode = "90210",
            City = "Beverly Hills",
            State = "CA",
            Address1 = "Address 10025",
        },                                                                        
        Phone = "403-222-6487",
        PhoneExtension = "",
        SmsNumber = "",
        Licenses = new [] {
            new {
                IsDeleted = "False",
                ID = "6",
                AdmissionDate = "2,1999",
                AdmissionDate_monthSelected = "2"
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In mvc3 application when I create new product, I want to add it's create
For an MVC3 application I want to create a reusable DAL that is accessed
I'm working on a ASP.NET MVC3 web application and I want to create a
I am building a new asp.net MVC3 web application for reporting and I want
Im want to create a data structure for using within my MVC3 application. The
I have a ‘Create’ page in my MVC3 application that has 4 input fields
To improve performance of our MVC3 application we want to mark some Controller's to
I want to build an ASP.NET MVC3 application but instead of a model I
Actually I have some MVC3 Applications and I want to call this applications from
I am fairly new to unit testing. I am building an ASP.NET MVC3 application

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.