我有 wcf 服务,我在下面提到了三个类,其中我使用前两个类从客户端获取对象。在StudentsInformation类上,我必须传递一个列表,即其中包含名称、标记、 avg等..我试图作为列表传递..我想根据主题的数量进行数据库更新,以及如何在WebcLient中检查......(即如何在列表中传递数据)你能帮我吗..有了这个
[DataContract(Name = "StudentsInformation")]
public class StudentsInformation
{
[DataMember]
public int ID { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public string Total { get; set; }
[DataMember]
public List<Subjects> Subjectslist { get; set; }
}
[DataContract(Name = "Subjects")]
public class Subjects
{
[DataMember]
public string SubjName { get; set; }
[DataMember]
public int Mark { get; set; }
[DataMember]
public int Avg { get; set; }
}
[DataContract(Name = "ReturnList")]
public class ReturnList
{
[DataMember]
public int TotalMark { get; set; }
[DataMember]
public int StudenID { get; set; }
[DataMember]
public int Rank { get; set; }
}
在 svc cs 我有
public List<ReturnList> GetStudentdetails(StudentsInformation objStudentsInfo)
{
string StudentName = objStudentsInfo.Name;
int StudentID = objStudentsInfo.ID;
List<ReturnList> data = new List<ReturnList>();
//loop with objStudentsInfo.Subjectslist and calls DB
return data;
}