Class InOperator<T>
Provides a safe way to include a Transact-SQL WHERE clause with an IN operator.
Namespace: Cuemon.Data
Assembly: Cuemon.Data.dll
Syntax
public abstract class InOperator<T>
Type Parameters
Name | Description |
---|---|
T | The type of the data in the IN operation of the WHERE clause. |
Constructors
| Improve this DocInOperator(T[])
Initializes a new instance of the InOperator<T> class.
Declaration
protected InOperator(params T[] expressions)
Parameters
Type | Name | Description |
---|---|---|
T[] | expressions | The expressions to test for a match in the IN operator of the WHERE clause. |
InOperator(IEnumerable<T>)
Initializes a new instance of the InOperator<T> class.
Declaration
protected InOperator(IEnumerable<T> expressions)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | expressions | The expressions to test for a match in the IN operator of the WHERE clause. |
Properties
| Improve this DocArguments
Gets the arguments for the IN operator.
Declaration
public string Arguments { get; }
Property Value
Type | Description |
---|---|
System.String | The arguments for the IN operator. |
Remarks
Default format of the arguments is @param0, @param1, @param2, etc. and is controlled by the ArgumentsSelector(T, Int32) method.
ParameterName
Gets the name of the parameter that will be concatenated with index
of both ArgumentsSelector(T, Int32) and ParametersSelector(T, Int32).
Declaration
protected string ParameterName { get; }
Property Value
Type | Description |
---|---|
System.String | The name of the parameter that will be concatenated with |
Parameters
Gets the parameters for the IN operator.
Declaration
public DbParameter[] Parameters { get; }
Property Value
Type | Description |
---|---|
System.Data.Common.DbParameter[] | The parameters for the IN operator. |
Methods
| Improve this DocArgumentsSelector(T, Int32)
A callback method that is responsible for the values passed to the Arguments property.
Declaration
protected virtual string ArgumentsSelector(T expression, int index)
Parameters
Type | Name | Description |
---|---|---|
T | expression | An expression to test for a match in the IN operator. |
System.Int32 | index | The index of the |
Returns
Type | Description |
---|---|
System.String | A System.String representing the argument of the |
Remarks
Default is @param{index}.
ParametersSelector(T, Int32)
A callback method that is responsible for the values passed to the Parameters property.
Declaration
protected abstract DbParameter ParametersSelector(T expression, int index)
Parameters
Type | Name | Description |
---|---|---|
T | expression | An expression to test for a match in the IN operator. |
System.Int32 | index | The index of the |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameter | An System.Data.Common.DbParameter representing the value of the |