<commit_before>﻿using System.Configuration;
using System.Reflection;
using System.Text;

namespace DevSpace.Database {
	internal static class Settings {
		static Settings() {
			foreach( PropertyInfo property in typeof( Settings ).GetProperties( BindingFlags.Static ) ) {
				property.SetValue( null, ConfigurationManager.AppSettings[property.Name] );
			}	
		}

		public static string Server {
			get;
			private set;
		}

		public static string Database {
			get;
			private set;
		}

		public static string Trusted_Connection {
			get;
			private set;
		}

		public static string UserID {
			get;
			private set;
		}

		public static string Password {
			get;
			private set;
		}

		public static string Encrypt {
			get;
			private set;
		}

		public static string ConnectionTimeout {
			get;
			private set;
		}

		public static string MultipleActiveResultSets {
			get;
			private set;
		}

		public static string ConnectionString {
			get {
				if( string.IsNullOrWhiteSpace( Server ) ) {
					foreach( PropertyInfo property in typeof( Settings ).GetProperties( BindingFlags.Static | BindingFlags.Public ) ) {
						property.SetValue( null, ConfigurationManager.AppSettings[property.Name] );
					}
				}

				StringBuilder builder = new StringBuilder();
				builder.AppendFormat( "Server={0};Database={1};", Server, Database );

				if( "TRUE".Equals( Trusted_Connection.ToUpper() ) ) {
					builder.Append( "Trusted_Connection=True;" );
				} else {
					builder.AppendFormat( "User ID={0};Password={1};Trusted_Connection=False;", UserID, Password );
				}

				builder.AppendFormat( "Encrypt={0};Connection Timeout={1};MultipleActiveResultSets={2}", Encrypt, ConnectionTimeout, MultipleActiveResultSets );
				return builder.ToString();
			}
		}
	}
}<commit_msg>The Settings constructor was failing because ConnectionString did not have a set. Added a permanate fix, so it doesn't spring back up if we create more computed properties later.<commit_after>﻿using System.Configuration;
using System.Reflection;
using System.Text;

namespace DevSpace.Database {
	internal static class Settings {
		static Settings() {
			foreach( PropertyInfo property in typeof( Settings ).GetProperties( BindingFlags.Static | BindingFlags.Public ) ) {
				if( null == property.SetMethod ) continue;
				property.SetValue( null, ConfigurationManager.AppSettings[property.Name] );
			}
		}

		public static string Server {
			get;
			private set;
		}

		public static string Database {
			get;
			private set;
		}

		public static string Trusted_Connection {
			get;
			private set;
		}

		public static string UserID {
			get;
			private set;
		}

		public static string Password {
			get;
			private set;
		}

		public static string Encrypt {
			get;
			private set;
		}

		public static string ConnectionTimeout {
			get;
			private set;
		}

		public static string MultipleActiveResultSets {
			get;
			private set;
		}

		public static string ConnectionString {
			get {
				StringBuilder builder = new StringBuilder();
				builder.AppendFormat( "Server={0};Database={1};", Server, Database );

				if( "TRUE".Equals( Trusted_Connection.ToUpper() ) ) {
					builder.Append( "Trusted_Connection=True;" );
				} else {
					builder.AppendFormat( "User ID={0};Password={1};Trusted_Connection=False;", UserID, Password );
				}

				builder.AppendFormat( "Encrypt={0};Connection Timeout={1};MultipleActiveResultSets={2}", Encrypt, ConnectionTimeout, MultipleActiveResultSets );
				return builder.ToString();
			}
		}
	}
}
{'fraction_non_alphanumeric': 0.10136674259681093, 'fraction_numerical': 0.003986332574031891, 'mean_word_length': 3.652980132450331, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7349776', 'n_tokens_mistral': 1217, 'n_tokens_neox': 972, 'n_words': 274}