Class DataItemProvider
- Namespace
- Dynamicweb.Deployment
- Assembly
- Dynamicweb.Core.dll
Represents a provider of data items. This is the base class that all data item providers must inherit from.
- Inheritance
-
Data
Item Provider
- Derived
- Inherited Members
Examples
using Dynamicweb.Extensibility.AddIns;
namespace Dynamicweb.Deployment.Examples
{
/// <summary>
/// This is an example of how to implement a custom data item provider.
/// Data item providers inherit from <see cref="ConfigurableAddIn"/> which means that you can add additional parameters for use when reading or writing data items.
/// </summary>
public class CustomDataItemProvider : DataItemProvider
{
/// <summary>
/// Gets or sets my property.
/// </summary>
[AddInParameter("MyProperty")]
public string MyProperty { get; set; }
public override DataItemReader CreateReader()
{
return new CustomDataItemReader(this);
}
public override DataItemWriter CreateWriter()
{
return new CustomDataItemWriter(this);
}
}
}
Properties
DataItemType
Gets the type of the data item.
Property Value
- Data
Item Type The type of the data item.
Methods
CreateInstance(DataItemType)
Creates an instance of a data item provider for a specific data item type.
Parameters
itemType
DataItem Type The data item type.
Returns
CreateReader()
Creates the data item reader.
Returns
- Data
Item Reader An instance of Data
Item .Reader
CreateWriter()
Creates the data item writer.
Returns
- Data
Item Writer An instance of Data
Item .Writer
GetDataProviderTypes()
Gets the data provider types.
Returns
GetParametersToDictionary()
Gets the parameters as a dictionary.
Returns
- IDictionary<string, string>
A dictionary of parameter keys and values
LoadParametersFromDictionary(IDictionary<string, string>)
Loads the parameters from dictionary.
Parameters
parameters
IDictionary<string, string>The parameters.