Exemplo n.º 1
0
        public IActionResult Delete(int id)
        {
            var client = _configurationDbContext.Clients
                         .Where(x => x.Id == id)
                         .AsNoTracking()
                         .FirstOrDefault();

            var model = ClientModel.FromEntity(client);

            return(View(model));
        }
Exemplo n.º 2
0
        public IActionResult Index()
        {
            var clients = _configurationDbContext.Clients
                          .Include(x => x.AllowedGrantTypes)
                          .Include(x => x.RedirectUris)
                          .Include(x => x.PostLogoutRedirectUris)
                          .Include(x => x.AllowedScopes)
                          .Include(x => x.ClientSecrets)
                          .Include(x => x.Claims)
                          .Include(x => x.IdentityProviderRestrictions)
                          .Include(x => x.AllowedCorsOrigins)
                          .Include(x => x.Properties)
                          .AsNoTracking()
                          .ToList();

            var models = clients.Select(x => ClientModel.FromEntity(x)).ToList();

            return(View(models));
        }
Exemplo n.º 3
0
        public IActionResult Edit(int id)
        {
            var client = _configurationDbContext.Clients
                         .Include(x => x.AllowedGrantTypes)
                         .Include(x => x.RedirectUris)
                         .Include(x => x.PostLogoutRedirectUris)
                         .Include(x => x.AllowedScopes)
                         .Include(x => x.ClientSecrets)
                         .Include(x => x.Claims)
                         .Include(x => x.IdentityProviderRestrictions)
                         .Include(x => x.AllowedCorsOrigins)
                         .Include(x => x.Properties)
                         .Where(x => x.Id == id)
                         .AsNoTracking()
                         .FirstOrDefault();

            var model = ClientModel.FromEntity(client);

            return(View(model));
        }
Exemplo n.º 4
0
        public IActionResult Clone(int id)
        {
            var client = _configurationDbContext.Clients
                         .Include(x => x.AllowedGrantTypes)
                         .Include(x => x.RedirectUris)
                         .Include(x => x.PostLogoutRedirectUris)
                         .Include(x => x.AllowedScopes)
                         .Include(x => x.ClientSecrets)
                         .Include(x => x.Claims)
                         .Include(x => x.IdentityProviderRestrictions)
                         .Include(x => x.AllowedCorsOrigins)
                         .Include(x => x.Properties)
                         .Where(x => x.Id == id)
                         .AsNoTracking()
                         .FirstOrDefault();

            var model = ClientModel.FromEntity(client);

            model.OriginalClientId = model.ClientId;
            model.ClientId         = $"Clone_From_{model.ClientId}_{DateTime.Now.ToString("yyyyMMddhhmmssfff")}";

            return(View(model));
        }