我有wcf服务,我在下面提到了三个类,其中我使用前两个类从客户端获取对象。在 StudentsInformation 类中,我必须传递一个列表,即包含名称,标记,平均等的子列表。我试图将其作为列表传递。我想根据主题数量进行数据库更新,以及如何在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;
}