コード例 #1
0
        public IActionResult RemoveDatabase()
        {
            _clientContext.RemoveRange(_clientContext.Clients);
            _scopeContext.RemoveRange(_scopeContext.Scopes);
            _operationalContext.RemoveRange(_operationalContext.Tokens);
            _operationalContext.RemoveRange(_operationalContext.Consents);

            _clientContext.SaveChanges();
            _scopeContext.SaveChanges();
            _operationalContext.SaveChanges();
            return(Json("Success"));
        }
コード例 #2
0
        public ActionResult DeleteScopes()
        {
            Message message = new Message();

            message.Success = true;
            try
            {
                _scopeContext.RemoveRange(_scopeContext.Scopes);
                _scopeContext.SaveChanges();
            }
            catch (Exception e)
            {
                message.Success = false;
                message.Content = "Delete fail:" + e.Message;
            }
            return(Json(message));
        }