WCF RIA服务中的服务器端代码没有执行

时间:2014-07-28 07:44:25

标签: c# .net silverlight wcf-ria-services ria

我是silverlight业务应用程序的新手。我的服务器端代码有问题。我在.Web app

中创建了这样的代码
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) { }

}

在客户端应用程序中查看以下内容的调用:     公共之家()         {             的InitializeComponent();

        this.Title = ApplicationStrings.HomePageTitle;
        //.net reflektor
        //DocList docList = new DocList();
        //docList.getDocListQuery();

        DocList x = new DocList();
        x.getDocListQuery();
   }

问题是我的服务器端代码没有调用。这不是一个debuger问题,因为即使Debug.WriteLine("Testuje debugera dokument")没有显示在输出部分

1 个答案:

答案 0 :(得分:0)

&#39; ave解决它。初学者的错误。我没有在我的silverlight应用程序中使用Load Operation