I have the following WCF DataContract:
[DataContract]
public class Occupant
{
private string _Name;
private string _Email;
private string _Organi
Because you have provided one or more initializing constructors, you will also need to add a parameterless (default) constructor.
i.e. You need to add:
[DataContract]
public class Occupant
{
// *** Needed only for Serialization
public Occupant() {}
...
This is because the default constructor disappears when you add an explicit constructor.
[The issue isn't with the method returning List
, since methods aren't serialized).]