Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Includes across multiple types
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chris Marisic  
View profile  
 More options May 2 2012, 3:03 pm
From: Chris Marisic <ch...@marisic.com>
Date: Wed, 2 May 2012 12:03:58 -0700 (PDT)
Local: Wed, May 2 2012 3:03 pm
Subject: Includes across multiple types

Suppose I have documents

thing { name:blah, owner: persons/1, id:things/1 }
thing { name:other, owner: company/1, id:things/2 }

person { name: bob, id:persons/1 }|
company { name:fedex, id:company/1 }|

Is it possible to do something like

session.Load<Thing


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Itamar Syn-Hershko  
View profile  
 More options May 2 2012, 3:09 pm
From: Itamar Syn-Hershko <ita...@hibernatingrhinos.com>
Date: Wed, 2 May 2012 22:09:50 +0300
Local: Wed, May 2 2012 3:09 pm
Subject: Re: [RavenDB] Includes across multiple types

No need

session.Load<Thing>(id).Include(x => x.Owner)

Will do

The server will look at the requested fields and pull the json docs from
store - it doesn't care about the type


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options May 2 2012, 3:15 pm
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Wed, 2 May 2012 22:15:52 +0300
Local: Wed, May 2 2012 3:15 pm
Subject: Re: [RavenDB] Includes across multiple types

It sounds like you are trying to dO multi level include, is this what you
are doIng?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Marisic  
View profile  
 More options May 2 2012, 3:24 pm
From: Chris Marisic <ch...@marisic.com>
Date: Wed, 2 May 2012 12:24:51 -0700 (PDT)
Local: Wed, May 2 2012 3:24 pm
Subject: Re: [RavenDB] Includes across multiple types

No I don't want to do a multiple level include, I'm exploring allowing 1
type of document (Thing) to have multiple types of owners and from what
Itamar said it should. Actually typing out code this should be the real
usage correct?

Session.Include<Thing>(x => x.Owner).Load<Thing>("things/1");

This almost seems wrong as I really want to get back a company or a person
depending on Owner, but I see it's setup like this so i can properly use
strongly typed access to reach x=>x.Owner of Thing, correct? That using
less strong typing that it would be the same as:
Session.Include("Owner").Load<Thing>("things/1"); correct?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Itamar Syn-Hershko  
View profile  
 More options May 2 2012, 6:12 pm
From: Itamar Syn-Hershko <ita...@hibernatingrhinos.com>
Date: Thu, 3 May 2012 01:12:06 +0300
Local: Wed, May 2 2012 6:12 pm
Subject: Re: [RavenDB] Includes across multiple types

Too many questions :)

The syntax is actually

Session.Include<Thing>(x => x.Owner).Load("things/1");

And what it does is pull the JSON documents "things/1" and all other
documents that are mentioned in it's x.Owner property. It doesn't care
about the type. The client API will do the conversion for you when you
deserialize (e.g. call Load and use that ID)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »