public bool Equals(MembershipPermission other)
 {
     if (Object.ReferenceEquals(other, null))
     {
         return(false);
     }
     if (Object.ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Name.Equals(other.Name));
 }
        public static MembershipPermission CreatePermission(string name)
        {
            MembershipPermission permission = _session.Permissions.FirstOrDefault(x => x.Name == name);

            if (permission == null)
            {
                permission = new MembershipPermission
                {
                    Name = name
                };

                _session.Add<MembershipPermission>(permission);
            }

            return permission;
        }
 public bool Equals(MembershipPermission other)
 {
     if (Object.ReferenceEquals(other, null)) return false;
     if (Object.ReferenceEquals(this, other)) return true;
     return Name.Equals(other.Name);
 }