Class ReturnFieldsCollection
The ReturnFieldsCollection is a Collection that is used to contain the different fields we are interested in when we are dealing with a select-command.
Inherited Members
Namespace: SuperOffice.Data.SQL
Assembly: SoDataBase.dll
Syntax
public class ReturnFieldsCollection : IEnumerable<Argument>, IEnumerable
Constructors
ReturnFieldsCollection()
Initializes a new instance of the ReturnFieldsCollection class.
Declaration
public ReturnFieldsCollection()
Properties
Count
The ReturnFieldsCollection is a Collection that is used to contain the different fields we are interested in when we are dealing with a select-command.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
this[int]
Returns the Argument on a specific index.
Declaration
public Argument this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index |
Property Value
| Type | Description |
|---|---|
| Argument |
Methods
Add(Argument)
Adds values to the collection based on the in-parameter.
Declaration
public void Add(Argument arg)
Parameters
| Type | Name | Description |
|---|---|---|
| Argument | arg | FieldInfo or function |
Remarks
Does not add duplicates. A field added twice will only appear once in the result set.
Add(params Argument[])
Adds values to the collection based on the in-parameter.
Declaration
public void Add(params Argument[] arguments)
Parameters
| Type | Name | Description |
|---|---|---|
| Argument[] | arguments | Argument collection to add |
Add(params TableInfo[])
Add all the fields from the given table(s) to the query
Declaration
public void Add(params TableInfo[] tableInfos)
Parameters
| Type | Name | Description |
|---|---|---|
| TableInfo[] | tableInfos | Array of zero or more tableInfo objects; All fields from each will be added to the query return fields |
AddRange(IEnumerable<Argument>)
Add a range of Arguments to the the collection
Declaration
public void AddRange(IEnumerable<Argument> arguments)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Argument> | arguments | Arguments to add to the collection. |
AddRange(IEnumerable<FieldInfo>)
Add a range of FieldInfos to the the colelction
Declaration
public void AddRange(IEnumerable<FieldInfo> arguments)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<FieldInfo> | arguments | Arguments to add to the collection. |
AggregationExist()
AggregationExist will check the ReturnFields-collection to see if it contains any Aggregation-Arguments. Will return true if aggregation exists unless the aggregation is of type Distinct. The rules of aggregation does not apply for Distinct.
Declaration
public bool AggregationExist()
Returns
| Type | Description |
|---|---|
| bool | Returns true if the collection contains a Aggregation-argument, else false. |
CheckCollectionForTopOperator()
CheckCollectionForTopOperator runs through the returnfieldcollection and makes sure that any existing TOP-object will be inserted into position 0 in the list.
Declaration
protected void CheckCollectionForTopOperator()
Clear()
Clear the return fields collection, removing all fields
Declaration
public void Clear()
FindFirstFieldFromTable(TableInfo)
Returns first field that belongs to the given table. Returns NULL if the table does not appear in the collection.
Declaration
public FieldInfo FindFirstFieldFromTable(TableInfo table)
Parameters
| Type | Name | Description |
|---|---|---|
| TableInfo | table | Table to search for in the return fields |
Returns
| Type | Description |
|---|---|
| FieldInfo | NULL on no match |
FindFirstTableFromTable(TableInfo)
Returns first table instance that belongs to the given table. Returns NULL if the table does not appear in the collection.
Declaration
public TableInfo FindFirstTableFromTable(TableInfo table)
Parameters
| Type | Name | Description |
|---|---|---|
| TableInfo | table | Table to search for in the return fields |
Returns
| Type | Description |
|---|---|
| TableInfo | NULL on no match |
FromFieldInfoArray(FieldInfo[])
Returns a ReturnFieldsCollection class, holding all the fields found in the fields argument.
Declaration
public static ReturnFieldsCollection FromFieldInfoArray(FieldInfo[] fields)
Parameters
| Type | Name | Description |
|---|---|---|
| FieldInfo[] | fields | The fields. |
Returns
| Type | Description |
|---|---|
| ReturnFieldsCollection | a ReturnFieldsCollection class, holding all the fields found in the fields argument. |
GetArgumentDataType(int)
GetArgumentDataType will return the FieldDataType of the Argument the in-parameter index points to.
Declaration
public FieldDataType GetArgumentDataType(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The index of the Argument we want the FieldDataType on. |
Returns
| Type | Description |
|---|---|
| FieldDataType | The FieldDataType of the Argument corresponding to the index. If no object is found on the index, FieldDataType.dbUnknown will be returned. |
GetEnumerator()
Returns an enumerator to the collection.
Declaration
public IEnumerator GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator |
GetIndexOfField(Argument)
The ReturnFieldsCollection is a Collection that is used to contain the different fields we are interested in when we are dealing with a select-command.
Declaration
[Obsolete("This is no longer used, as it is now exposed through the dialect.", true)]
public int GetIndexOfField(Argument field)
Parameters
| Type | Name | Description |
|---|---|---|
| Argument | field |
Returns
| Type | Description |
|---|---|
| int |
GetNumberOfItems()
Returns number of items in the collection.
Declaration
public int GetNumberOfItems()
Returns
| Type | Description |
|---|---|
| int |
GetReturnFieldList()
The ReturnFieldsCollection is a Collection that is used to contain the different fields we are interested in when we are dealing with a select-command.
Declaration
public List<Argument> GetReturnFieldList()
Returns
| Type | Description |
|---|---|
| List<Argument> |
Remove(params Argument[])
Remove one or more fields / arguments from the returnfieldscollection
Declaration
public void Remove(params Argument[] arguments)
Parameters
| Type | Name | Description |
|---|---|---|
| Argument[] | arguments |
ToString()
String output.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | field, field, ... |
Overrides
Operators
implicit operator ReturnFieldsCollection(FieldInfo[])
Returns a ReturnFieldsCollection class, holding all the fields found in the fields argument.
Declaration
public static implicit operator ReturnFieldsCollection(FieldInfo[] fields)
Parameters
| Type | Name | Description |
|---|---|---|
| FieldInfo[] | fields | The fields. |
Returns
| Type | Description |
|---|---|
| ReturnFieldsCollection | a ReturnFieldsCollection class, holding all the fields found in the fields argument. |