-
-
Notifications
You must be signed in to change notification settings - Fork 0
201.Connection String Generator
Foxtension provides a set of strongly-typed builders for generating connection strings in a safe and structured way. Instead of manually constructing connection strings, developers can use dedicated builder classes to reduce errors and improve readability.
The following builders are available:
- SQL Server Connection String Builder
- SQLite Connection String Builder
- FTP Connection String Builder
var sqlserver = new SqlServerCSBuilder
{
DatabaseName = "test",
DataSource = "",
ServerAddress = "127.0.0.1",
ServerPort = 8080, // default is null
IntegratedSecurity = false, // true -> no username & password | false -> requires credentials
Username = "Admin",
Password = "123",
Encryption = true, // default is true
MultipleActiveResultSets = false, // default is false
PersistSecurityInfo = false, // default is false
Pooling = false, // default is false
TrustServerCertificate = true // default is true
}.Build();This builder constructs a valid SQL Server connection string based on provided configuration options. It supports both credential-based and integrated authentication modes.
var sqlite = new SqLiteCSBuilder
{
DatabaseName = "test",
TargetPath = @"Path/to/your/db file/"
}.Build();This builder generates a SQLite connection string based on a database file path and database name. It is designed for lightweight local database usage.
var ftp = new FtpCSBuilder
{
ServerAddress = "127.0.0.1",
ServerPort = 21,
Username = "root",
Password = "123"
}.Build();This builder constructs an FTP connection string for connecting to remote FTP servers using authentication credentials.
Thrown when a required string parameter is null or empty. This applies to fields such as:
|
Thrown when numeric parameters are outside valid ranges. Examples:
|
- All builders validate input before generating the final connection string.
- Default values are applied where optional parameters are not provided.
- SQL Server builder supports both integrated security and credential-based authentication.
- SQLite builder is intended for local file-based databases.
- FTP builder is designed for basic authentication scenarios and does not include advanced TLS configuration in its current version.
Foxtension is an evolving cross-platform utility framework. The API surface, behavior, and available modules may change across versions.
For the latest updates, documentation improvements, and release notes, please refer to the official repository.
- Project: Foxtension
- Type: Cross-platform .NET utility framework
- License: Apache 2.0
- Maintainer: (cmd_er / Teamemories)
- This documentation reflects the current stable version of Foxtension.
- Some APIs may behave differently across operating systems.
- Experimental features may change or be removed in future releases without prior notice.
|
|
|