Quantcast
Channel: CSLA .NET
Viewing all articles
Browse latest Browse all 764

Can not directly save a child object (CSLA 4.5)

$
0
0

I am baffled as to why I am getting this error given that I am calling save on the Collection not the child. Any thoughts?

 

Class Structure:

CountryList – EditableRootCollection

Country – EditableChild

 

Code: 

Country mCountry = Country.NewCountry();

mCountry.CountryCode = "TST";

mCountry.CountryName = "Test Country";

 

mCountryList = CountryList.GetAll();

mCountryList.Add(mCountry);

mCountryList =  mCountryList.Save();

 

Exception:

DataPortal.Update failed (Can not directly save a child object)


Viewing all articles
Browse latest Browse all 764

Trending Articles