0
我有wcf服務,我在下面提到了三個類,其中我使用前兩個類從客戶端獲取對象..在StudentsInformation class i have to傳遞一個列表,其中包含名稱,標記,平均等等的子列表列表,其中我試圖通過列表..我想根據主題數量進行數據庫更新,以及如何在WebcLient中檢查此列表。 ..(即如何通過列表中的數據),你能不能幫這個me..with如何在wcf中的對象中使用列表對象
[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;
}