【问题标题】:Server Side code in WCF RIA services doesn't execkWCF RIA 服务中的服务器端代码不执行
【发布时间】: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


    【解决方案1】:

    我已经解决了。初学者的愚蠢错误。我没有在我的 silverlight 应用程序中使用 LoadOperation

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-22
      • 1970-01-01
      • 2012-01-14
      • 2011-11-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多