Silverlight 4 RIA 不会使用 DomainContext 返回任何内容

发布于 2024-08-25 07:52:30 字数 742 浏览 3 评论 0原文

刚刚学习 Silverlight 4/RIA,我陷入了一个奇怪的问题: 设置 ASP.NET MVC 项目作为托管域服务的项目。在此,我尝试从域服务获取数据,该数据运行良好(我正在使用使用温莎城堡解析的存储库)。

现在我尝试设置一个 SL4 项目。我虽然是用 MVVM 方式来做的,所以我决定使用以下代码设置一个 ViewModel 类:

public class ViewModel
{
        OrganizationDomainContext dsCtxt = new OrganizationDomainContext();

        public ViewModel()
        {
           EntityQuery<Culture> query = from cu in dsCtxt.GetAllCulturesQuery()
                                         select cu;
            LoadOperation<Culture> lo = dsCtxt.Load(query);

        }

}

疯狂的是......它不返回任何东西! 我在这里缺少什么?

编辑: 我对这个问题不是很清楚:我正在使用 Windsor Castle 来做 IoC 的事情。使用 Fiddler,我看到该应用程序尝试解析类似于 Silverlight 应用程序名称的内容。

提前致谢

Just learning Silverlight 4/RIA and i 'm stuck in a weird problem:
setup an ASP.NET MVC project as the project hosting the Domain service. In this i tried to get data from the Domain Service which worked fine (i'm using a repository which gets resolved using Windsor Castle).

Now i tried to setup a SL4 project. I though i do it the MVVM-way, so i decided to setup a ViewModel Class with the following code:

public class ViewModel
{
        OrganizationDomainContext dsCtxt = new OrganizationDomainContext();

        public ViewModel()
        {
           EntityQuery<Culture> query = from cu in dsCtxt.GetAllCulturesQuery()
                                         select cu;
            LoadOperation<Culture> lo = dsCtxt.Load(query);

        }

}

The crazy thing about this is .. it doesn't return anything!!!
What am i missing here?

EDIT:
I was not very clear about this issue: i 'm using Windsor Castle to do IoC stuff. Using Fiddler i see that the application tries to resolve something that looks like the name of the Silverlight application.

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傲影 2024-09-01 07:52:30

事实证明,前面提到的 Silverlight 应用程序实际上是我用来获取数据的服务。我解决了这个忽略该服务的路由问题(在 RegisterRoutes() 中),如下所示:

routes.IgnoreRoute("{*allsvc}", new { allsvc = @".*\.svc(/.*)?" });

It turns out that the aforementioned Silverlight application is actually the service i'm using to get data. I solved this ignoring routing issues to this service (in RegisterRoutes() ) like this:

routes.IgnoreRoute("{*allsvc}", new { allsvc = @".*\.svc(/.*)?" });
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文