コード例 #1
0
ファイル: Role.cs プロジェクト: GrillerGeek/RavenDBMembership
 public Role(string name, Role parentRole)
 {
     this.Name = name;
     if (parentRole != null)
     {
         this.ParentRoleId = parentRole.Id;
     }
 }
コード例 #2
0
        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;
            }
        }