asp.net 2.0
llblgenpro 2
adapterTemplate
hiya,
I've started using preFetch paths, and I'm hoping they can help me with the following:
I have an entityCollection, "jobItems" based on the following schema:
tblJobItem
jobItemId PK
assignedTOUserId FK --> tblUser.userId
assignebBYUserid FK --> tblUser.userId
tblUser
userId PK
userName
I'm binding the jobItems entityColection to a dataGrid.
I need to be able to display the "username" for the people who:
1) assigned the job (tblJobItem.assignedTOUserId) -->tblUser.Username
2) were assigned the job (tblJobItem.assignebBYUserid) -->tblUser.Username
If prefetch paths aren't the best approach, please stop me now.
If it is, then I need to somehow do the following:
<%# Eval("User.userName") %>
..but how would I differnetiate between assignedTOUserId and assignebBYUserid?
This is the code I have so far:
EntityCollection jobItems = new EntityCollection(new JobItemEntityFactory());
IPrefetchPath2 prefetchPath = new PrefetchPath2((int)EntityType.JobItemEntity);
prefetchPath.Add(JobItemEntity.PrefetchPathUser);
DataAccessAdapter adapter = new DataAccessAdapter();
adapter.FetchEntityCollection(jobItems, null, prefetchPath);
any help appreciated.
ta,
yogi