Exemplo n.º 1
0
 public static IdentityResource ToModel(this Models.IdentityResource model)
 {
     if (model == null)
     {
         return(null);
     }
     return(new IdentityResource(model.Name, model.DisplayName, model.UserClaims)
     {
         Enabled = model.Enabled,
         Description = model.Description,
         Required = model.Required,
         Emphasize = model.Emphasize,
         ShowInDiscoveryDocument = model.ShowInDiscoveryDocument,
         UserClaims = model.UserClaims,
         Name = model.Name,
         DisplayName = model.DisplayName
     });
 }
Exemplo n.º 2
0
        public static IdentityResource ToModel(this Models.IdentityResource model)
        {
            if (model == null)
            {
                throw new ArgumentNullException(nameof(model));
            }

            return(new IdentityResource(model.Name, model.DisplayName, model.UserClaims)
            {
                Enabled = model.Enabled,
                Description = model.Description,
                Required = model.Required,
                Emphasize = model.Emphasize,
                ShowInDiscoveryDocument = model.ShowInDiscoveryDocument,
                UserClaims = model.UserClaims ?? new List <string>(),
                Name = model.Name,
                DisplayName = model.DisplayName
            });
        }