public static void Main(string[] args) { ILog logger = null; try { string logfile = Path.Combine(Directory.GetCurrentDirectory(), "log-4net.config"); XmlConfigurator.Configure(new FileInfo(logfile)); logger = LogManager.GetLogger("Logger"); IConfiguration config = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json") .Build(); DatabaseConnectionParams dbConnectionParam = new DatabaseConnectionParams(); config.Bind("AppSettings:DatabaseConnection", dbConnectionParam); IHostBuilder hostBuilder = CreateHostBuilder(); if (hostBuilder != null) { hostBuilder.Build().Run(); } } catch (Exception ex) { logger.Error("Main Service-> Exception: " + ex.Message); } }
public override void OnInspectorGUI() { DatabaseConnectionParams connectionParams = (DatabaseConnectionParams)target; EditorGUI.BeginChangeCheck(); connectionParams.dataSource = EditorGUILayout.TextField("Data Source", connectionParams.dataSource); connectionParams.databaseName = EditorGUILayout.TextField("Database", connectionParams.databaseName); connectionParams.username = EditorGUILayout.TextField("Username", connectionParams.username); connectionParams.password = EditorGUILayout.PasswordField("Data Source", connectionParams.password); if (EditorGUI.EndChangeCheck()) { EditorUtility.SetDirty(connectionParams); } }