EF CTP 5 create and persist object graph trouble
Code:

    Something smt = new Something(){
    Prop = 123,
    Prop2 = "asdad"
    }

    foreach(var related in relatedsomething)
    {
        smt.Related.Add(new Related(){
        relatedprop = 123,
        };
    }


Runtime gives me an error about null reference.
Related is  virtual Icollection<Related>.
no foreign key fields in entities defined.



on contrary if I do

    foreach(var related in relatedsomething)
    {
    db.Related.Add(new Related(){
        relatedprop = 123,
        Something = smt
        };
    }

It works.  
Although, I Want it to work as in first snippet.  
Am I doing something wrong? 'Cos in shipped EF4 it works both ways.

EF CTP 5 create and persist object graph trouble
===

Code:

    Something smt = new Something(){
    Prop = 123,
    Prop2 = "asdad"
    }

    foreach(var related in relatedsomething)
    {
        smt.Related.Add(new Related(){
        relatedprop = 123,
        };
    }


Runtime gives me an error about null reference.
Related is  virtual Icollection<Related>.
no foreign key fields in entities defined.



on contrary if I do

    foreach(var related in relatedsomething)
    {
    db.Related.Add(new Related(){
        relatedprop = 123,
        Something = smt
        };
    }

It works.  
Although, I Want it to work as in first snippet.  
Am I doing something wrong? 'Cos in shipped EF4 it works both ways.
