0

I have a class object like this:

public class SomeClass{
     public SpecialFields specialFields { get;set;

}

The property SpecialFields is made of a number of arrays:

public class SpecialFields {
       public FieldString[] FieldStrings {get;set;}
       public FieldDateTime[] FieldDateTimes {get;set;
}

The array FieldDateTimes looks like:

public class FieldDateTime{
       public string Name {get;set;}
       public string Reference {get;set;}
       public DateTime Value {get;set; 
}

When I serialize the 'SomeClass' object all the fields get serialized except 'Value'. Is there any way to tell why the XML serializer is ignoring the Value property? The 'Name' and 'Reference' properties do get included.

John M
  • 14,338
  • 29
  • 91
  • 143
  • 4
    Can you please post a minimal and reproducible example? Also, you're missing some closing `}` in some of the properties must be a type-o? – Trevor Aug 20 '21 at 17:39
  • 3
    something similar : https://stackoverflow.com/a/2038683/6271132 – mabiyan Aug 20 '21 at 17:53
  • @zaggler - Not sure what to show. It's like there is a hidden mapping somewhere that has determined the 'Value' field isn't relevant. – John M Aug 20 '21 at 17:57
  • 1
    @ashmabi - thanks. There was a 'valuespecified' field that was being missed. You can post an answer and I will accept it. – John M Aug 20 '21 at 18:09

0 Answers0