none
How to deserialize only part of an XML string to a c# object? RRS feed

  • Question

  • I developed a c# application which receive data from user and then generate and save a XML file to a physical path.

    1. User input personal information in string format in the application

    e.g.: <UserSegment><Name>John</Name><Gender>M</Gender></UserSegment>

    2. The application de-serialize the string to an object

    3. The application get images from database

    4. The application pass image values to the object

    5. The application serialize the object to XML

    Sample of XML output:

    <?xml version="1.0" encoding="UTF-8"?>
    <Applicant>
    <UserSegment>
    <Name>John</Name>
    <Gender>M</Gender>
    </UserSegment>
    <Photo>ESN76By/EvzeXi8FYHH0gUakAkA+D4E=</Photo>
    </Applicant>
    How to deserialize only part of an XML string to a c# object?

    Thursday, December 14, 2017 8:58 AM

Answers

  • Maybe define two classes: one with few members and another with more members. (Consider derived classes too). Use the appropriate one depending on needs.

    • Marked as answer by tonylck Thursday, December 28, 2017 3:43 AM
    Thursday, December 14, 2017 10:02 AM

All replies

  • Maybe define two classes: one with few members and another with more members. (Consider derived classes too). Use the appropriate one depending on needs.

    • Marked as answer by tonylck Thursday, December 28, 2017 3:43 AM
    Thursday, December 14, 2017 10:02 AM
  • Hi tonylck,

    Welcome to the MSDN forum.

    Refer to your description, your issue is about C# development. Since our forum is to discuss the VS IDE, I will help you move this thread to the appropriate forum to seek for a better support, thank you for your understanding.

    Best regards,

    Sara


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, December 15, 2017 3:01 AM