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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:13:28+00:00 2026-06-17T20:13:28+00:00

example: a Customer class have 100 data member(id, name, age, address…etc) to be serialization

  • 0

example: a Customer class have 100 data member(id, name, age, address…etc) to be serialization to JSON.

In Config file such as Web.config, can set a output list to serialize JSON ouptut.

If output only id and name, then JSON only have id and name.

My Question: Can support dynamic DataMember in a DataContract ?

  • 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-17T20:13:29+00:00Added an answer on June 17, 2026 at 8:13 pm

    You mean optional datamembers, I guess so, check this question
    Surely you’ll have to have null values for the ones you dont want to send over the wire.
    Another, more dirtier, solution would be to use a dictionary as a datamember and have the fields you want to send as elements there. There may be type conversion issues, but maybe it serves you better.

    Edit:

    You probably want to go with a dictioray serialized as an associative array en js, as this question specifies. Check the answers and the links in there. That should get you going.
    But still I’d go with optional datamembers since it’s more of a “contract” thing. Other than that a better description of what you want to do will help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have (for example) these two objects: class Customer { public int Id {
I have these 3 models in models.py class Customer(models.Model): name = models.CharField(max_length=50) .... class
In my application I have a Customer class and an Address class. The Customer
I have a customer class which has both PhoneNumber and Email properties. Using DataAnnotations
I have a simple class that contains a hashmap: @XmlRootElement() public class Customer {
I have customer data stored in two different databases. The records are kept in
For example, I have a class, that looks like: public class Repository<T> { public
I have a class in vb.net like Public Class Customer Private _Name As String
If I have the LINQ objects: public class SampleDataContext : DataContext { public Table<Customer>
I have 4 Classes. Supplier, Customer, Employee, and Address. Any of the first 3

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.