Hi!
I've got 3 tables in the scenario that I'm working with - User, Role and UserRole (to maintain the many-to-many relationship between User and Role).
I've got the join between all 3 tables using RelationPredicateBucket.Relations but can't seem to figure out how to add the "Where username contains 'xyz'" condition.
Here's my code snippet:
EntityCollection<UsersEntity> usersColl = new EntityCollection<UsersEntity>();
RelationPredicateBucket rpb = new RelationPredicateBucket();
rpb.Relations.Add(UserRolesEntity.Relations.UsersEntityUsingUserId, JoinHint.Inner);
rpb.Relations.Add(RolesEntity.Relations.UserRolesEntityUsingRoleId, JoinHint.Inner);
rpb.PredicateExpression.AddWithAnd(RolesFields.Name == roleName);
//TODO add expression UsersFields.EmailId.Contains(usernameToMatch)
//rpb.PredicateExpression.AddWithAnd(UsersFields.EmailId.
DataAccessAdapter daa = new DataAccessAdapter();
daa.FetchEntityCollection(rolesColl, rpb);
Any help appreciated.
Regards,
Nitin