Show / Hide Table of Contents

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.

Inheritance
Object
ReturnFieldsCollection
Implements
IEnumerable
IEnumerable<Argument>
Namespace: SuperOffice.Data.SQL
Assembly: SoDataBase.dll
Syntax
public class ReturnFieldsCollection : Object, IEnumerable, IEnumerable<Argument>

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
Int32

Item[Int32]

Returns the Argument on a specific index.

Declaration
public Argument this[int index] { get; }
Parameters
Type Name Description
Int32 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(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(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
Boolean

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 FieldInfo 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 FieldInfo argument.

GetArgumentDataType(Int32)

GetArgumentDataType will return the FieldDataType of the Argument the in-parameter index points to.

Declaration
public FieldDataType GetArgumentDataType(int index)
Parameters
Type Name Description
Int32 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
public int GetIndexOfField(Argument field)
Parameters
Type Name Description
Argument field
Returns
Type Description
Int32

GetNumberOfItems()

Returns number of items in the collection.

Declaration
public int GetNumberOfItems()
Returns
Type Description
Int32

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(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, ...

Operators

Implicit(FieldInfo[] to ReturnFieldsCollection)

Returns a ReturnFieldsCollection class, holding all the fields found in the FieldInfo 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 FieldInfo argument.

Implements

System.Collections.IEnumerable
System.Collections.Generic.IEnumerable<T>

Extension Methods

EnumUtil.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top