【发布时间】:2014-07-28 07:44:25
【问题描述】:
我是 silverlight 业务应用程序的新手。我的服务器端代码有问题。我已经在 .Web 应用程序中创建了这样的代码
public class Doc
{
public Doc() { }
public Doc(Guid ID, Guid ProjektId, string Name)
{
this.ID = ID;
this.ProjektID = ProjektID;
this.Name = Name;
}
[Key]
public Guid ID { get; set; }
public Guid ProjektID { get; set; }
public string Name { get; set; }
}
// TODO: Create methods containing your application logic.
[EnableClientAccess()]
public class DocList : DomainService
{
[Query]
public List<Doc> getDocList()
{
Debug.WriteLine("Testuje debugera dokument");
//getImlArray();
List<Doc> docList = new List<Doc>();
docList.Add(new Doc(Guid.Empty, Guid.Empty, "t1"));
docList.Add(new Doc(Guid.Empty, Guid.Empty, "t21"));
docList.Add(new Doc(Guid.Empty, Guid.Empty, "t211"));
return docList;
}
[Insert]
public void emptyInsert(Doc project) { }
[Update]
public void emptyUpdater(Doc project) { }
[Delete]
public void emptyDelete(Doc project) { }
}
在客户端应用程序中查看这样的调用: 公共主页() { 初始化组件();
this.Title = ApplicationStrings.HomePageTitle;
//.net reflektor
//DocList docList = new DocList();
//docList.getDocListQuery();
DocList x = new DocList();
x.getDocListQuery();
}
问题是我的服务器端代码没有被调用。这不是调试器问题,因为即使Debug.WriteLine("Testuje debugera dokument") 也不会显示在输出部分中
【问题讨论】:
标签: c# .net silverlight wcf-ria-services ria