Silverlight 4 RIA 不会使用 DomainContext 返回任何内容
刚刚学习 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,前面提到的 Silverlight 应用程序实际上是我用来获取数据的服务。我解决了这个忽略该服务的路由问题(在 RegisterRoutes() 中),如下所示:
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: