Ok,
i got an entity which has got a FK in it.
this has a relation to another table (otherwise it wouldn't be a Foreignkey)
what i want is to fetch a collection of the table of that FK.
i already can access the entity with the foreignkey.
sideinfo: i want to "dynamic" create a dropdownlist for that foreign-key.
now i'm doing:
LoadData() {
CreateDropDownListForFoo();
CreateDropDownListForBar();
etc.
}
CreateDropDownListForFoo() {
FooCollection f = new FooCollection();
f.getMulti(null)l
etc. etc.
}
what i kinda want:
LoadData() {
someEntity ent = new someEntity();
if (ent.Fields[x].IsForeignKey) {
CreateDropDownList(ent.Fields[x]);
}
CreateDropDownList(EntityField field) {
//getcollection of the table from the field.
// field is foreign-key so it's bound to a table
}
ps. if i can generate this with the template-generator only, that's also cool