Show / Hide Table of Contents

Class FieldInfoCollection

The FieldInfoCollection class

Inheritance
Object
FieldInfoCollection
Implements
IEnumerable<FieldInfo>
IEnumerable
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.Data.SQL
Assembly: SoDataBase.dll
Syntax
public class FieldInfoCollection : IEnumerable<FieldInfo>, IEnumerable

Constructors

FieldInfoCollection()

Declaration
public FieldInfoCollection()

Properties

Item[Int32]

Returns the FieldInfo on a specific index.

Declaration
public FieldInfo this[int index] { get; }
Parameters
Type Name Description
Int32 index
Property Value
Type Description
FieldInfo

Methods

Add(FieldInfo)

Adds values to the collection based on the in-parameter.

Declaration
public int Add(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo
Returns
Type Description
Int32

Add(FieldInfo[])

Adds values to the collection based on the in-parameter.

Declaration
public void Add(params FieldInfo[] fieldInfos)
Parameters
Type Name Description
FieldInfo[] fieldInfos

Add(FieldInfoCollection)

Adds values to the collection based on the in-parameter.

Declaration
public void Add(FieldInfoCollection fieldInfos)
Parameters
Type Name Description
FieldInfoCollection fieldInfos

Contains(FieldInfo)

Contains checks the FieldInfo collection for a specific FieldInfo.

Declaration
public bool Contains(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

The FieldInfo we want to know if exists or not.

Returns
Type Description
Boolean

Returns true if the FieldInfo exists, false if not.

FromFieldInfoArray(FieldInfo[])

Convert an array into a collection explicitly.

Declaration
public static FieldInfoCollection FromFieldInfoArray(FieldInfo[] fieldInfos)
Parameters
Type Name Description
FieldInfo[] fieldInfos

Array

Returns
Type Description
FieldInfoCollection

A new collection containing the fields

GetEnumerator()

Returns an enumerator to the collection.

Declaration
public IEnumerator GetEnumerator()
Returns
Type Description
IEnumerator

GetIndexOfField(FieldInfo)

Get the index of a field.

Declaration
public int GetIndexOfField(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

The field info.

Returns
Type Description
Int32

0 based index of the field. -1 is returned if the field is not found.

Remarks

Tries to resolve the field by using the following strategies in this order:

  • Same instance of table and field.
  • Same table and field name or full field number.
It is important to distinguish two fields of the same type from each other if a table is joined twice, like joining both street and postal address with contact. Hence; it is important to have the same instance of the TableInfo for both building up the query and receiving data from the result.

GetNumberOfItems()

Returns number of items in the collection.

Declaration
public int GetNumberOfItems()
Returns
Type Description
Int32

GetPrimaryKeyInFieldInfoCollection(FieldInfoCollection)

If there is a FieldInfo in the collection that is a primary key, this function will find and return it.

Declaration
public FieldInfo GetPrimaryKeyInFieldInfoCollection(FieldInfoCollection fields)
Parameters
Type Name Description
FieldInfoCollection fields

The FieldInfo-collection containing all necessary fields for the sql-statement.

Returns
Type Description
FieldInfo

The primary-key as FieldInfo

PrimaryKeyExist()

This function will check if the FieldInfoCollection contains a primaryKey. If it does, it will return true, if not, false.

Declaration
public bool PrimaryKeyExist()
Returns
Type Description
Boolean

True/False

ValidateFieldInfoCollection(Boolean)

CheckFieldInfoCollectionReady will validate the in-coming FieldInfoCollection. The function will check the following: The collection IS NOT null, The collection contains at least one FieldInfo, The collection contains a Primary-key. If the checkPrimaryKeyExists is true, the existence of a primary-key will be checked. Needed when dealing with for example a insert-statement. The ArgumentParameterCollection need the primary-key to be able to insert the data in a unique row in the database.

Declaration
public bool ValidateFieldInfoCollection(bool checkPrimaryKeyExists)
Parameters
Type Name Description
Boolean checkPrimaryKeyExists

True, we check the collection for the existence of a primary-key. False, we skip this test.

Returns
Type Description
Boolean

True if the collection is validated correct. Will throw an SoIllegalOperationException if not.

Operators

Implicit(FieldInfo[] to FieldInfoCollection)

Convert an array into a collection

Declaration
public static implicit operator FieldInfoCollection(FieldInfo[] fieldInfos)
Parameters
Type Name Description
FieldInfo[] fieldInfos

Array

Returns
Type Description
FieldInfoCollection

A new collection containing the fields

Explicit Interface Implementations

IEnumerable<FieldInfo>.GetEnumerator()

Declaration
IEnumerator<FieldInfo> IEnumerable<FieldInfo>.GetEnumerator()
Returns
Type Description
IEnumerator<FieldInfo>

Implements

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

Extension Methods

EnumUtil.MapEnums<From, To>(From)
IEnumerableExtensions.ForEach<T>(System.Collections.Generic.IEnumerable<T>, System.Action<T>)
IEnumerableExtensions.ContainsAny<T>(System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IEnumerable<T>)
IEnumerableExtensions.Batch<T>(System.Collections.Generic.IEnumerable<T>, System.Int32)
IEnumerableExtensions.IndexOf<T>(System.Collections.Generic.IEnumerable<T>, T, System.Int32)
IEnumerableExtensions.IndexOf<T>(System.Collections.Generic.IEnumerable<T>, System.Func<T, System.Boolean>, System.Int32)
IEnumerableExtensions.Permute<T>(System.Collections.Generic.IEnumerable<T>, System.Int32)
IEnumerableExtensions.PermissiveToDictionary<T, K, V>(System.Collections.Generic.IEnumerable<T>, System.Func<T, K>, System.Func<T, V>)
IEnumerableExtensions.PermissiveToDictionary<T, K, V>(System.Collections.Generic.IEnumerable<T>, System.Func<T, K>, System.Func<T, V>, System.Collections.Generic.IEqualityComparer<K>)
IEnumerableExtensions.GetDifferentCombinations<T>(System.Collections.Generic.IEnumerable<T>, System.Int32)
CollectionOps.AtLeastOne<T>(IEnumerable<T>)
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