예제 #1
0
        public IActionResult ApIScopeManager(string id, string name)
        {
            APIscopeModel model = new APIscopeModel();

            model.Apiid              = id;
            model.Apiname            = name;
            ViewBag.APIScoperesource = LoadScopeAPI(id);
            return(View(model));
        }
예제 #2
0
        public ActionResult CreateApIScope(APIscopeModel model)
        {
            string sql = "INSERT INTO \"ApiScopes\" (\"Name\",\"DisplayName\",\"Description\",\"Required\",\"Emphasize\",\"ShowInDiscoveryDocument\",\"ApiResourceId\") VALUES ( @name,@displayname,@description,false,false,true,cast(@apiid as int));";

            var paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("name", model.APIScopeName),
                new KeyValuePair <string, string>("displayname", model.DisplayName),
                new KeyValuePair <string, string>("description", model.Description),
                new KeyValuePair <string, string>("apiid", model.Apiid)
            };

            try
            {
                DataServices.executeSQLStatement(sql, paramList, "connectionString_SynapseIdentityStore");
            }
            catch (Exception ex)
            {
            }
            return(RedirectToAction("ApIScopeManager", "ManageAPIs", new { @id = model.Apiid, @name = model.Apiname }));
        }