I want to return List in my web method like below,
public List<Object> MyMethod(){
List<Object> list = new List<Object>();
myClass a = new myClass();
list.Add(a);
return list;
}
public class myClass{
public int StudetNumber {get; set;}
public string StudentName {get; set;}
public decimal average {get; set;}
}
But i get this error : System.InvalidOperationException : myClass is not expected. System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(string name, string ns, Object o , Boolean xsiType);
I don't get the error when it returns List of myClass. It is possible to return List of System.Object or Do I have to return List of myClass ?
Thanks for advance.