开发者

Silverlight 4 RIA does not return anything using DomainContext

开发者 https://www.devze.com 2022-12-22 12:25 出处:网络
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 wo

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
{
        O开发者_JS百科rganizationDomainContext 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


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(/.*)?" });
0

精彩评论

暂无评论...
验证码 换一张
取 消