所以我在下面的每个部分都坚持了一些事情,它们对于堆栈中的大多数人来说都是微不足道的,所以我想知道我是否可以就以下代码段中的三个问题获得帮助,我遇到的问题是:
我的运营合同如下所示:
[OperationContract]
[WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml, UriTemplate = "")]
List<Tag> GetTagCollection();
#endregion
我的数据合同如下所示:
[DataContract(Name="Student")]
public class Student
{
[DataMember(Name = "StudentID")]
public string StudentID { get; set; }
[DataMember(Name = "FirstName")]
public string FirstName { get; set; }
[DataMember(Name = "LastName")]
public string LastName { get; set; }
}
我的服务工作如下所示:
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
public class RawDataService : IReceiveData
{
public List<Group> GetGroupsCollection(string TagName)
{
List<Group> groups = (from g in _program.Groups // _program does not exist notsure what goes here
where
(from t in g.Tags where t.Name == TagName select t).Count() > 0
select g).ToList();
return groups;
}