Class CommandBuilderBase
Provides base and common functionality for all kind of command builders.
Inheritance
Namespace: Paradigm.ORM.Data.CommandBuilders
Assembly: Paradigm.ORM.Data.dll
Syntax
public abstract class CommandBuilderBase : object, ICommandBuilder, IDisposable
  Constructors
| Improve this Doc View SourceCommandBuilderBase(IDatabaseConnector, ITableDescriptor)
Initializes a new instance of the CommandBuilderBase class.
Declaration
protected CommandBuilderBase(IDatabaseConnector connector, ITableDescriptor descriptor)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IDatabaseConnector | connector | A database connector.  | 
      
| ITableDescriptor | descriptor | A table type descriptor.  | 
      
Properties
| Improve this Doc View SourceCommand
Gets the command instance.
Declaration
protected IDatabaseCommand Command { get; set; }
  Property Value
| Type | Description | 
|---|---|
| IDatabaseCommand | 
Connector
Gets the current database connector.
Declaration
protected IDatabaseConnector Connector { get; }
  Property Value
| Type | Description | 
|---|---|
| IDatabaseConnector | 
Descriptor
Gets the table descriptor related with the command builder.
Declaration
protected ITableDescriptor Descriptor { get; }
  Property Value
| Type | Description | 
|---|---|
| ITableDescriptor | 
Remarks
Command builders are related and constructed arround a given type, and the ORM uses TableDescriptor to gain contextual information about the table.
FormatProvider
Gets the command format provider related to the current connector.
Declaration
protected ICommandFormatProvider FormatProvider { get; }
  Property Value
| Type | Description | 
|---|---|
| ICommandFormatProvider | 
Methods
| Improve this Doc View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
  GetDbParameterNames(IEnumerable<IColumnDescriptor>, String)
Gets a string by joining all the property names, separated by a comma or a provided separator.
Declaration
protected virtual string GetDbParameterNames(IEnumerable<IColumnDescriptor> columns, string separator = ",")
  Parameters
| Type | Name | Description | 
|---|---|---|
| IEnumerable<IColumnDescriptor> | columns | Array of column property descriptors.  | 
      
| System.String | separator | String separator. Comma is the default character used if no other is provided.  | 
      
Returns
| Type | Description | 
|---|---|
| System.String | A string with all the parameter names.  | 
      
Examples
@param1,@param2,@param3,...,@paramN
| Improve this Doc View SourceGetDbParameterNamesAndValues(IEnumerable<IColumnDescriptor>, String)
Gets a string by joining all the property name and values, separated by comma or a provided separator.
Declaration
protected virtual string GetDbParameterNamesAndValues(IEnumerable<IColumnDescriptor> columns, string separator = ",")
  Parameters
| Type | Name | Description | 
|---|---|---|
| IEnumerable<IColumnDescriptor> | columns | Array of column property descriptors.  | 
      
| System.String | separator | String separator. Comma is the default character used if no other is provided.  | 
      
Returns
| Type | Description | 
|---|---|
| System.String | 
Examples
@param1='value1',@param2='value2',@param3='value3',...,@paramN='value4'
| Improve this Doc View SourceGetPropertyNames()
Gets all the property names separated wht commas and scaped.
Declaration
protected virtual string GetPropertyNames()
  Returns
| Type | Description | 
|---|---|
| System.String | All the property names.  | 
      
GetPropertyNames(IEnumerable<IColumnDescriptor>)
Gets all the property names separated wht commas and scaped.
Declaration
protected virtual string GetPropertyNames(IEnumerable<IColumnDescriptor> descriptors)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IEnumerable<IColumnDescriptor> | descriptors | Array of column property descriptors.  | 
      
Returns
| Type | Description | 
|---|---|
| System.String | All the property names.  | 
      
GetTableName()
Gets the name of the table already scaped.
Declaration
protected virtual string GetTableName()
  Returns
| Type | Description | 
|---|---|
| System.String | The name of the table.  | 
      
PopulateParameters()
Populates the command parameters using the collection of columns of the table type descriptor.
Declaration
protected virtual void PopulateParameters()
  PopulateParameters(IEnumerable<IColumnDescriptor>)
Populates the command parameters using the collection of columns.
Declaration
protected virtual void PopulateParameters(IEnumerable<IColumnDescriptor> columns)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IEnumerable<IColumnDescriptor> | columns | Array of column property descriptors  |