Adding new DatabaseConfig components in the Client project for supported Databases to avoid deploying server dlls to client

This commit is contained in:
Charles Nurse
2021-04-27 15:35:10 -07:00
parent 8f5beaf3fe
commit 1efd623a99
19 changed files with 664 additions and 303 deletions

View File

@ -10,27 +10,6 @@ namespace Oqtane.Databases
private static string _friendlyName => "Local Database";
private static string _name => "LocalDB";
private static readonly List<ConnectionStringField> _connectionStringFields = new()
{
new() {Name = "Server", FriendlyName = "Server", Value = "(LocalDb)\\MSSQLLocalDB", HelpText="Enter the database server"},
new() {Name = "Database", FriendlyName = "Database", Value = "Oqtane-{{Date}}", HelpText="Enter the name of the database"}
};
public LocalDbDatabase() :base(_name, _friendlyName, _connectionStringFields) { }
public override string BuildConnectionString()
{
var connectionString = String.Empty;
var server = ConnectionStringFields[0].Value;
var database = ConnectionStringFields[1].Value;
if (!String.IsNullOrEmpty(server) && !String.IsNullOrEmpty(database))
{
connectionString = $"Data Source={server};AttachDbFilename=|DataDirectory|\\{database}.mdf;Initial Catalog={database};Integrated Security=SSPI;";
}
return connectionString;
}
public LocalDbDatabase() :base(_name, _friendlyName) { }
}
}