示例#1
0
        private (DbSettings dbSettings, InstanceSettings instanceSettings) Convert(LocalSettingsData data)
        {
            var dbSettings = new DbSettings
            {
                Type     = data.DbType,
                Host     = data.DbHost,
                Name     = data.DbName,
                User     = data.DbUser,
                Password = data.DbPassword
            };
            var instancesSettings = new InstanceSettings
            {
                Domain = data.InstanceDomain
            };

            return(dbSettings, instancesSettings);
        }
示例#2
0
        private LocalSettingsData GetDataFromUser()
        {
            var data = new LocalSettingsData();

            Console.WriteLine("Db Host:");
            data.DbHost = Console.ReadLine();

            Console.WriteLine("Db Name:");
            data.DbName = Console.ReadLine();

            Console.WriteLine("Db User:"******"Db Password:"******"Instance Domain:");
            data.InstanceDomain = Console.ReadLine();

            return(data);
        }
示例#3
0
        private void SaveLocalSettings(LocalSettingsData data)
        {
            var jsonContent = JsonConvert.SerializeObject(data);

            File.WriteAllText(LocalFileName, jsonContent);
        }