This question is locked. New answers and comments are not allowed.
Hi,
I am new to OpenAccess. I am having one problem. Can any one help me with the following.
I have two class user and role like following. I need to find out all the role which has specific user
I was trying to do the following but getting error. How can I do this?
I am new to OpenAccess. I am having one problem. Can any one help me with the following.
I have two class user and role like following. I need to find out all the role which has specific user
I was trying to do the following but getting error. How can I do this?
IObjectScope scope = ObjectScopeProvider1.GetNewObjectScope();
scope.Transaction.Begin();
var result = from r in scope.Extent<Role>()
join u in scope.Extent<User>()
on r.RoleDbId equals u.UserDbId
where u.UserName == "iivaan"
select r;
scope.Transaction.Commit();
foreach (Role role in result)
{
Console.WriteLine(role.RoleName);
}
Using a JOIN directly is currently not supported.
public class User
{
public int UserDbId;
public String UserName = null;
public IList<Role> roles = new List<Role>();
}
public partial class Role
{
public int RoleDbId = -1;
public String RoleName = null;
public IList<User> users = new List<User>();
}