Write-BackingSourceConfig
Note
This feature is only available in NCache OpenSource edition.
Write-BackingSourceConfig
enables the user to generate the configuration as an output, which configures read-thru and write-thru providers. The configuration can either be displayed on the console or in the file specified.
Write-BackingSourceConfig [-AssemblyPath] [-Class ] [-ProviderName] [-OutputFile] [-Parameters] [-ReadThru] [-WriteThru] [-DefaultProvider] [-NoLogo]
Examples
- The following command generates the configurations to be added to configure read-thru provider for the class SqlReadThruProvider from the given assembly on the path specified.
Write-BackingSourceConfig -AssemblyPath "C:\Program Files\NCache\samples\dotnet\BackingSource\Providers\Sql\bin\BackingSource.Providers.Sql.dll" -Class Alachisoft.NCache.Samples.Providers.SqlReadThruProvider -ReadThru -ProviderName sqlreader -OutputFile d:\sqlreaderconfig.xml
- The following example generates the configurations to be added to configure write-thru provider for the class SqlWriteThruprovider on the console.
Write-BackingSourceConfig -AssemblyPath "C:\Program Files\NCache\samples\dotnet\BackingSource\Providers\Sql\bin\BackingSource.Providers.Sql.dll" -Class Alachisoft.NCache.Samples.Providers.SqlWriteThruProvider -WriteThru -ProviderName sqlwriter
The command displays the following output on the console.
- The following command generates the configurations to be added to configure read-thru provider for the class SqlReadThruProvider from the given assembly on the path specified using the specified default provider.
Note
DefaultProvider
configuration is recommended only in case of multiple providers.
Write-BackingSourceConfig -AssemblyPath "C:\Program Files\NCache\samples\dotnet\BackingSource\Providers\Sql\bin\BackingSource.Providers.Sql.dll" -Class Alachisoft.NCache.Samples.Providers.SqlReadThruProvider -ReadThru -ProviderName sqlreader -OutputFile d:\sqlreaderconfig.xml -DefaultProvider sqlreader
- The following example generates the configurations to be added to configure write-thru provider for the class SqlWriteThruprovider on the specified path using the custom provided parameters.
Note
In case of multiple parameters, separate the key-value pairs with '$' sign.
Write-BackingSourceConfig -AssemblyPath "C:\Program Files\NCache\samples\dotnet\BackingSource\Providers\Sql\bin\BackingSource.Providers.Sql.dll" -Class Alachisoft.NCache.Samples.Providers.SqlWriteThruProvider -WriteThru -ProviderName sqlwriter -OutputFile d:\sqlwriterconfig.xml -Parameters 'connstring=Data Source=20.200.20.30;Initial Catalog=Northwind;Persist Security Info=True;User ID=sa;Password=***'
Properties
Note: The parameters with asterisk (*) on their names are the required parameters and the rest are optional.
Parameters | Data Types | Description | Default Value |
---|---|---|---|
-AssemblyPath* |
<String> |
Specifies the path of the assembly which will be configured as a backing source. | - |
-Class |
<String> |
Specifies the fully qualified class from the backing source assembly which implements ReadThru/WriteThru. | - |
-ReadThru |
<SwitchParameter> |
Specifies if provided backing source is configured for ReadThru. | False |
-WriteThru |
<SwitchParameter> |
Specifies if provided backing source is configured for WriteThru. | False |
-ProviderName* |
<String> |
Specifies the provider name. | - |
-DefaultProvider |
<SwitchParameter> |
Specifies if provider is default provider. | False |
-Parameters |
<String> |
Specifies the list of the parameters passed to the backing source provider '$' separated e.g. key1=value1'$'key2=value2'$'... | - |
-OutputFile |
<string> |
Specifies the path of the output file in which configuration will be written. | - |
-NoLogo |
<SwitchParameter> |
Suppresses display of the logo banner. | False |