Hello, Im quite new to NHibernate.
Im stuck and Im asking for help. I modeled one-to-many relation and result of display differs from what I expected.
There is master table COUNTRY with country name and capital name. There is also a child table named CITY with city name and FK to COUNTRY to assign which city belongs to which country.
Using a query criteria like that:
IList countryList = session.CreateCriteria(typeof(Country)).List();
and bind to standard .NET grid with
this.dataGrid1.DataSource = countryList;
I got it displayed in this way:
Thats some kind different to this what I expected. I rather wanted to have it displayed fully. I mean, if there are f.e. 3 child records in CITIES table assigned to one country I wanted to have 3 records on the grid even if fields country and capital will be doubled. Data is read correctly from, in debug I can see that under this
(Collection) lies an object which is correctly filled with data.
I suppose I should change CreateCriteria but the problem is that I didnt find many examples so far.
Do you have any hints how to proceed?[/b]