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); }
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); }
private void SaveLocalSettings(LocalSettingsData data) { var jsonContent = JsonConvert.SerializeObject(data); File.WriteAllText(LocalFileName, jsonContent); }