public Role(string name, Role parentRole) { this.Name = name; if (parentRole != null) { this.ParentRoleId = parentRole.Id; } }
public static string CreateRole(IDocumentStore store, string roleName, string applicationName) { using (var session = store.OpenSession()) { var role = new Role(roleName, null); role.ApplicationName = applicationName; session.Store(role); session.SaveChanges(); return role.Id; } }