示例#1
0
        public void SetDefaultProject(int projectid)
        {
            ConfigurationWriter configurationWriter = new ConfigurationWriter();

            configurationWriter.AddOrUpdateAppSetting <int>(Constants.DEFAULT_PROJECTID, projectid);

            Console.WriteLine("Default Project was successfuly set.", ConsoleColor.Green);
        }
示例#2
0
        public IActionResult ChangeKey(ApiKeyItem item)
        {
            var hashedKey = KeyHash.GetStringSha256Hash(item.ApiKey);
            var result    = ConfigurationWriter.AddOrUpdateAppSetting("ApiKey", hashedKey);

            if (!result.Success)
            {
                return(NotFound(new StatusMessageResponse <ApiKeyItem>(item, "Failed to write to configuration file")));
            }

            return(Ok(new StatusMessageResponse <ApiKeyItem>(item, "Successfully changed Api Key. Please restart the Webserver for the changes to take affect.")));
        }