Class StorageConnectionString
Holds a parsed connection string to the storage
Inheritance
Inherited Members
Namespace: Bayat.SaveSystem.Storage
Assembly: Bayat.SaveSystem.Runtime.dll
Syntax
public class StorageConnectionString
Constructors
| Improve this Doc View SourceStorageConnectionString(String)
Creates a new instance of StorageConnectionString
Declaration
public StorageConnectionString(string connectionString)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString |
Fields
| Improve this Doc View SourceNativeParameterName
Declaration
public static string NativeParameterName
Field Value
Type | Description |
---|---|
System.String |
Properties
| Improve this Doc View SourceConnectionString
Original connection string
Declaration
public string ConnectionString { get; }
Property Value
Type | Description |
---|---|
System.String |
IsNative
Determines if this is a native connection string
Declaration
public bool IsNative { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Item[String]
Gets or sets connection string parameters
Declaration
public string this[string key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | key |
Property Value
Type | Description |
---|---|
System.String |
Native
Returns native connection string, or null if connection string is not native
Declaration
public string Native { get; }
Property Value
Type | Description |
---|---|
System.String |
Parameters
Connection string parameters exposed as key-value pairs
Declaration
public Dictionary<string, string> Parameters { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.String> |
Prefix
Prefix of this connection string, excluding prefix separator, i.e. for 'disk://something' the prefix is 'disk'
Declaration
public string Prefix { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceGet(String, String, String[])
Get connection string parameter by name
Declaration
public string Get(string parameterName, string defaultValue, params string[] aliases)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | |
System.String | defaultValue | |
System.String[] | aliases |
Returns
Type | Description |
---|---|
System.String | Parameter value. If parameter is not set returns an empty string |
GetBoolean(String, Boolean, String[])
Get connection string parameter by name
Declaration
public bool GetBoolean(string parameterName, bool defaultValue, params string[] aliases)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | |
System.Boolean | defaultValue | |
System.String[] | aliases |
Returns
Type | Description |
---|---|
System.Boolean | Parameter value. If parameter is not set returns an empty string |
GetFloat(String, Single, String[])
Get connection string parameter by name
Declaration
public float GetFloat(string parameterName, float defaultValue, params string[] aliases)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | |
System.Single | defaultValue | |
System.String[] | aliases |
Returns
Type | Description |
---|---|
System.Single | Parameter value. If parameter is not set returns an empty string |
GetInteger(String, Int32, String[])
Get connection string parameter by name
Declaration
public int GetInteger(string parameterName, int defaultValue, params string[] aliases)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | |
System.Int32 | defaultValue | |
System.String[] | aliases |
Returns
Type | Description |
---|---|
System.Int32 | Parameter value. If parameter is not set returns an empty string |
GetRequired(String, Boolean, out String, String[])
Gets the value of the parameter as when it's required. When parameter is not present, throws standard System.ArgumentException
Declaration
public void GetRequired(string parameterName, bool requireNonEmptyValue, out string value, params string[] aliases)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | Parameter name |
System.Boolean | requireNonEmptyValue | When true, checks that parameter value is not null or empty and throws System.ArgumentException |
System.String | value | Result value |
System.String[] | aliases |
GetRequiredBoolean(String, Boolean, out Boolean, String[])
Gets the value of the parameter as when it's required. When parameter is not present, throws standard System.ArgumentException
Declaration
public void GetRequiredBoolean(string parameterName, bool requireNonEmptyValue, out bool value, params string[] aliases)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | Parameter name |
System.Boolean | requireNonEmptyValue | When true, checks that parameter value is not null or empty and throws System.ArgumentException |
System.Boolean | value | Result value |
System.String[] | aliases |
GetRequiredFloat(String, Boolean, out Single, String[])
Gets the value of the parameter as when it's required. When parameter is not present, throws standard System.ArgumentException
Declaration
public void GetRequiredFloat(string parameterName, bool requireNonEmptyValue, out float value, params string[] aliases)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | Parameter name |
System.Boolean | requireNonEmptyValue | When true, checks that parameter value is not null or empty and throws System.ArgumentException |
System.Single | value | Result value |
System.String[] | aliases |
GetRequiredInteger(String, Boolean, out Int32, String[])
Gets the value of the parameter as when it's required. When parameter is not present, throws standard System.ArgumentException
Declaration
public void GetRequiredInteger(string parameterName, bool requireNonEmptyValue, out int value, params string[] aliases)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | Parameter name |
System.Boolean | requireNonEmptyValue | When true, checks that parameter value is not null or empty and throws System.ArgumentException |
System.Int32 | value | Result value |
System.String[] | aliases |
ToString()
Returns a string representation of the connection string
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |