One-to-One or one-to-many

Feb 19, 2010 at 10:15 PM


when i use the northwind database. Why is in the result the Orders of the Customers not filled??

 var customers = (from d in db.Customers

 where d.Phone != "0921-12 34 65" <font size="2">



select d).First()

Feb 19, 2010 at 10:25 PM

Retrieving associated data is expensive.  You have to specify which associations you want loaded by asking for them using a QueryPolicy.  The latest release, v0.17, introduces a new class EntityPolicy that is an implementation of QueryPolicy that you can use to specify which associations are loaded.  See this blog post for more details.

Feb 22, 2010 at 1:12 PM

thx that did the job!

I have question with the following problem:

public class DbKleurGroep
        public int id { get; set; }
        public string naam { get; set; }
DbContext db = new DbContext();
DbKleurGroep kleurgroep = new DbKleurGroep(){naam="test"};
db.Kleur_Groepen.SetSubmitAction(kleurgroep, IQToolkit.SubmitAction.Insert);

After the DbKleurGroep is added in the database i want to that he ID is automatically is filled again. Is that possible with a property?




Feb 22, 2010 at 10:50 PM

The EntitySession class does not currently handle resynching object state after insert/update.

Feb 23, 2010 at 1:13 PM

Well the only way to this is this way?

public virtual IUpdatable Kleur_Groepen
        get { return this.Provider.GetTable("kleur_groepen"); }

DbKleurGroep kleurgroep = new DbKleurGroep() { naam = "test" }; = db.Kleur_Groepen.Insert(kleurgroep, (c =>



Feb 24, 2010 at 5:16 PM

Yes, that's currently the only way to do it.