Exemplo n.º 1
0
 public ClaimsUser(ClaimsUserEntity entity) : base(entity.Id, entity.Name, entity.DisplayName)
 {
     this._Claims = new Dictionary <string, string>();
     if (entity.Claims != null)
     {
         foreach (var pair in entity.Claims)
         {
             this._Claims.Add(pair.Key, pair.Value);
         }
     }
     this._Claims["Id"]          = entity.Id.ToString();
     this._Claims["Name"]        = entity.Name;
     this._Claims["DisplayName"] = entity.DisplayName;
 }
Exemplo n.º 2
0
        public ClaimsUserEntity ToEntity(ClaimsUserEntity entity = null)
        {
            if (entity == null)
            {
                entity = new ClaimsUserEntity();
            }
            entity.Id   = this.Id;
            entity.Name = this.Name;
            lock (this)
            {
                entity.DisplayName = this.DisplayName;
                entity.ClaimJSON   = JSON.Serialize(this._Claims);
            }

            return(entity);
        }