Is it possible to detect the following situation (with a compiler warning or with an external tool):
public class SomeItem
{
public string ValueOne { get; set; }
public string ValueTwo { get; set; }
}
[DataContract]
public class Response
{
[DataMember]
public List<SomeItem> Items { get; set; } //A desirable warning: SomeItem is NOT a DataContract, SomeItem has no member with the DataMember attribute.
}
The problem is that this code can be compiled without an error or a warning, but it doesn’t work properly: Items will always be empty.