entity framework 4 - EF Code first doesn't load my collection of child objects -


i have 2 objects:

public class program  {            [key]     [databasegenerated(databasegeneratedoption.identity)]            public long id { get; set; }            public string name { get; set; }         public virtual icollection<videofile> files { get; set; } }  public class videofile     {            [key]         [databasegenerated(databasegeneratedoption.identity)]                public long id { get; set; }            [required]         public string path { get; set; }         [required]         public virtual program program { get; set; }            } 

the 2 tables correctly created in database, when save program insert files childs too, when tried program file collection come nulls, have lazyload enable, , default entity framework return empty collection when child collection empty why have null?


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -