You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class Admin
{
public string Id {get; set;}
public string UserName {get; set;}
public List<Role> Roles {get; set;}
}
public class Role
{
public string Id {get; set;}
public string Name {get; set;}
public List<Admin> AdminInRole {get; set;
}
BsonMapper.Global.Entity<Admin>()
.DbRef(x => x.Roles , "roles");
BsonMapper.Global.Entity<Role>()
.DbRef(x => x.AdminInRole , "admins")
Is there a way to make this work so that if I insert a role into Admin, and then query the role (including AdminInRole) I'd get the admin that has been assigned the role, too?
The text was updated successfully, but these errors were encountered:
I have two entities that are linked together:
Is there a way to make this work so that if I insert a role into Admin, and then query the role (including
AdminInRole
) I'd get the admin that has been assigned the role, too?The text was updated successfully, but these errors were encountered: