Hi,
for an academicyear, there is only one staffhistory entity.
i think creating a staffhistory entity by providing the staffid and academicyearid is the easiest way to go.
i was thinking maybe i could create a staff entity that has the matching staffhistory entity that is filtered by the academicyearid but i think it doesnt make a lot of sense.
something like staff.staffhistory.somefieldofstaffhistory which will give me the value of somefieldofstaffhistory for the staff entity and selected academic year.
creating a seperate staffhistory entity is a lot easier i guess.
thank you
-shane
daelmo wrote:
Hi Shane,
There are a lot of ways to do that. For example you could do something like this (for your previous posts I assume you are using SelfServicing):
PredicateExpression filter = new PredicateExpression();
filter.Add(StaffHistoryFields.AcademicYearId = someValue);
StaffHistoryCollection staffHistories = new StaffHistoryCollection();
staffHistories.GetMulti(filter);
// then you can access the entities like this (for instance):
foreach(StaffHistory sh staffHistories)
{
string someString = sh.SomeFieldOfStaffHistory;
string anotherString = sh.Staff.SomeFieldOfStaff;
}
If you will need to access a lot of related fields at once you can use PrefetchPaths to improve the performance.
Is that what you are looking for?