Hi Everyone,
I tried the following code in "UserEntity" Class:
public static HelperClasses.EntityCollection GetUserByEmail(int userId)
{
EntityCollection col = new EntityCollection(new UserEntityFactory());
DataAccessAdapter da = new DataAccessAdapter();
RelationPredicateBucket b = new RelationPredicateBucket();
IPredicateExpression filter = new PredicateExpression();
filter.Add(PredicateFactory.CompareValue(UserFieldIndex.userId,
ComparisonOperator.Equal, userId));
b.PredicateExpression.Add(filter);
da.FetchEntityCollection(col, b);
return col;
}
Here, based on the userId passed to the fuction, it retrieves the corresponding row from the "User" table.
But i need to access another table "UserAddress" to get the address for the user.
So based on the UserId i need to retrieve.
User Table contains - userId, userName columns.
UserAddress Table contains - userId, Address1,Address2 columns.
Plz help to solve this issue.
Thanks in Advance,
Dhivya.