不能在siverlight linq中使用Join [英] Can't use Join in siverlight linq

查看:87
本文介绍了不能在siverlight linq中使用Join的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试通过Odata服务在siverlight中从crm访问数据.
我想根据联系人姓名检索帐户信息.
出于与查询中使用联接相同的目的.
在"_account.LoadAsync(qery2);"处执行时我收到不支持Join的错误.

我的问题可能很愚蠢,但如果你们中的任何一个可以帮助我,我将不胜感激.

在此先感谢


我使用的命名空间

Hi,

I am trying to access data from crm in siverlight through Odata Service.
I want to retrive account info on the basis of contact name.
for the same purpose I used join in my query.
While executing at "_account.LoadAsync(qery2);" I get error that Join is not supported.

My question might be silly but I would be too grateful to you If any one of you could help me out.

Thanks in advance


Namespaces I used

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.ComponentModel;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using SilverlightApplication55.ServiceReference1;
using ctccrm.ODataService;
using ctccrm.OrgService;
using System.Data.Services.Client;
using System.Windows.Navigation;
using System.ServiceModel.DomainServices.Client.ApplicationServices;
using System.Windows.Data;
using System.Collections.ObjectModel;
using System.ServiceModel.DomainServices.Client;




代码段




Code Snippet

var qery2 = from a in context.AccountSet
            join c in context.ContactSet on a.PrimaryContactId.Id equals c.ContactId
            where c.FullName.Contains("Prateek")
            select a;



account.LoadCompleted += new EventHandler<LoadCompletedEventArgs> _account_LoadCompleted_1);

            _account.LoadAsync(qery2);

推荐答案



我不是一个非常有经验的CRM开发人员,但是我认为问题是CRM 2011将其转换为Odata表达式,该表达式可以使用扩展来实现联接,但我不知道如何,但是我认为即使这样做,它仍然很薄弱.
我更喜欢写单独的查询,然后在客户端将它们加入.
Hi,

I am not a very experienced CRM developer but I think the problem is CRM 2011 converts this to an Odata expression which could implement joins using expands but I don''t know how but I think even though it does it is quite weak at doing so.
I prefer to write to seperate queries and join them on client side.


这篇关于不能在siverlight linq中使用Join的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆