Does your context implement IExpandProvider?
On Friday, June 22, 2012 1:51:36 PM UTC+1, João Ferreira wrote:
>
> Hi
>
> I am having the same problem. Have you solved it somehow? Has a bug been
> reported?
>
> Regards
>
> On Monday, May 9, 2011 2:47:10 PM UTC+1, Vagif Abilov wrote:
>>
>> Hi,
>>
>> After resolving my issue with navigation to referenced entities (thanks
>> Ricardo), I am now testing possibility to fetch in OData only referenced
>> entities. The following query fetches main entity and it's Products
>> relation:
>> Categories.Expand("Products").Where(c => c.CategoryID == 1)
>> (corresponds to
>> http://localhost:50555/NorthwindEntityFrameworkModelFirstMsSql.svc/Categories(1)?$expand=Products
>> )
>>
>> This is not what I want: I only need Products. I don't want to do
>> projection on the client.
>>
>> When using Entity Framework, I can use the following (weird) C# syntax in
>> client code:
>> from c in Categories.Where(c => c.CategoryID == 1) select new { Products
>> = c.Products }
>>
>> But this does not work in NHibernate! I am getting NotImplemented
>> exception:
>>
>> <message xml:lang="nb-NO">Not Implemented</message>
>> <innererror>
>> <message>([100001] As Categories)</message>
>> <type>System.NotSupportedException</type>
>> ...
>> </message>
>>
>> And using Expand("Products") does not seem to support projections:
>> Categories.Expand("Products").Where(c => c.CategoryID == 1).Select(x =>
>> x.Products) results in "The method 'Select' is not supported." both for
>> NHibernate and Entity Framework.
>>
>> Do you know about any workaround for this that will work in NHibernate?
>>
>> Thanks in advance
>>
>> Vagif
>>
>>
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/nhusers/-/xhuSCx3Ox10J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.