Class S
Inherited Members
Namespace: SuperOffice.Data
Assembly: SoDataBase.dll
Syntax
public static class S
Methods
And(IEnumerable<Restriction>)
Combines the provided restriction-objects into one restriction using a logical AND. If no valid restrictions are provided, null will be returned.
Declaration
public static Restriction And(this IEnumerable<Restriction> instance)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Restriction> | instance | An enumerable of Restriction. Can be null. |
Returns
Type | Description |
---|---|
Restriction | A new restriction based on the provided restriction-enumerable. |
DeleteFromSelect<TI>(TargetedSelect<TI>, BatchSave)
Evaluate a TargetedSelect<MainTableInfo>, fetch primary keys, and generate a BatchSave that contains delete's for each row
Declaration
public static BatchSave DeleteFromSelect<TI>(TargetedSelect<TI> select, BatchSave batch = null) where TI : TableInfo
Parameters
Type | Name | Description |
---|---|---|
TargetedSelect<TI> | select | |
BatchSave | batch | BatchSave to add deletes to |
Returns
Type | Description |
---|---|
BatchSave |
Type Parameters
Name | Description |
---|---|
TI |
LookupSingleField<T, R>(Func<T, FieldInfo>, int)
Declaration
public static R LookupSingleField<T, R>(Func<T, FieldInfo> getField, int primaryKey) where T : TableInfo where R : new()
Parameters
Type | Name | Description |
---|---|---|
Func<T, FieldInfo> | getField | |
int | primaryKey |
Returns
Type | Description |
---|---|
R |
Type Parameters
Name | Description |
---|---|
T | |
R |
NewDelete()
Returns a new instance of the Delete class.
Declaration
public static Delete NewDelete()
Returns
Type | Description |
---|---|
Delete | a new instance of the Delete class. |
NewDelete(FieldInfo, int)
Returns a new, populated instance of the Delete class.
Declaration
public static Delete NewDelete(FieldInfo keyField, int keyValue)
Parameters
Type | Name | Description |
---|---|---|
FieldInfo | keyField | |
int | keyValue |
Returns
Type | Description |
---|---|
Delete | a new instance of the Delete class. |
NewDelete(string)
Returns a new instance of the Delete class.
Declaration
public static Delete NewDelete(string origin)
Parameters
Type | Name | Description |
---|---|---|
string | origin | This text is included - if possible - as an SQL comment in the generated SQL statement. It will usually be visible in database tracing tools, and the intention is to make it possible to identify the code that gave created a particular query. This has great "forensic" value when investigating performance or reverse-engineering the system. |
Returns
Type | Description |
---|---|
Delete | a new instance of the Delete class. |
NewDelete<TI>(int)
Returns a new, populated instance of the Delete class.
Declaration
public static Delete NewDelete<TI>(int keyValue) where TI : TableInfo
Parameters
Type | Name | Description |
---|---|---|
int | keyValue |
Returns
Type | Description |
---|---|
Delete | a new instance of the Delete class. |
Type Parameters
Name | Description |
---|---|
TI |
NewInsert()
Returns a new instance of the Insert class.
Declaration
public static Insert NewInsert()
Returns
Type | Description |
---|---|
Insert | a new instance of the Insert class. |
NewInsert(string)
Returns a new instance of the Insert class.
Declaration
public static Insert NewInsert(string origin)
Parameters
Type | Name | Description |
---|---|---|
string | origin | This text is included - if possible - as an SQL comment in the generated SQL statement. It will usually be visible in database tracing tools, and the intention is to make it possible to identify the code that gave created a particular query. This has great "forensic" value when investigating performance or reverse-engineering the system. |
Returns
Type | Description |
---|---|
Insert | a new instance of the Insert class. |
NewInsertFromSelect()
Returns a new instance of the InsertFromSelect class
Declaration
public static InsertFromSelect NewInsertFromSelect()
Returns
Type | Description |
---|---|
InsertFromSelect |
NewSelect()
Returns a new instance of the Select class.
Declaration
public static Select NewSelect()
Returns
Type | Description |
---|---|
Select | a new instance of the Select class. |
NewSelect(string)
Returns a new instance of the Select class.
Declaration
public static Select NewSelect(string origin)
Parameters
Type | Name | Description |
---|---|---|
string | origin | This text is included - if possible - as an SQL comment in the generated SQL statement. It will usually be visible in database tracing tools, and the intention is to make it possible to identify the code that gave created a particular query. This has great "forensic" value when investigating performance or reverse-engineering the system. |
Returns
Type | Description |
---|---|
Select | a new instance of the Select class. |
NewSelect<MainTableInfo>()
Returns a new instance of a targeted select (one that knows its main table, and has an instance of it)
Declaration
public static TargetedSelect<MainTableInfo> NewSelect<MainTableInfo>() where MainTableInfo : TableInfo
Returns
Type | Description |
---|---|
TargetedSelect<MainTableInfo> | Select object |
Type Parameters
Name | Description |
---|---|
MainTableInfo | TableInfo for which to create a select |
NewSelect<MainTableInfo>(TableInfo, Func<MainTableInfo, Restriction>)
Declaration
public static TargetedSelect<MainTableInfo> NewSelect<MainTableInfo>(TableInfo targetTable, Func<MainTableInfo, Restriction> initialRestriction) where MainTableInfo : TableInfo
Parameters
Type | Name | Description |
---|---|---|
TableInfo | targetTable | |
Func<MainTableInfo, Restriction> | initialRestriction |
Returns
Type | Description |
---|---|
TargetedSelect<MainTableInfo> |
Type Parameters
Name | Description |
---|---|
MainTableInfo |
NewSelect<MainTableInfo>(IEnumerable<int>)
Returns a new instance of a targeted select (one that knows its main table, and has an instance of it)
Declaration
public static TargetedSelect<MainTableInfo> NewSelect<MainTableInfo>(IEnumerable<int> primaryKey) where MainTableInfo : TableInfo
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<int> | primaryKey | An enumeration of primary keys, for which an IN restriction is created |
Returns
Type | Description |
---|---|
TargetedSelect<MainTableInfo> | Select object |
Type Parameters
Name | Description |
---|---|
MainTableInfo | TableInfo for which to create a select |
NewSelect<MainTableInfo>(Func<MainTableInfo, Restriction>)
Returns a new instance of a targeted select (one that knows its main table, and has an instance of it)
Declaration
public static TargetedSelect<MainTableInfo> NewSelect<MainTableInfo>(Func<MainTableInfo, Restriction> initialRestriction) where MainTableInfo : TableInfo
Parameters
Type | Name | Description |
---|---|---|
Func<MainTableInfo, Restriction> | initialRestriction | An initial restriction to include in the select, based on a tableinfo instance |
Returns
Type | Description |
---|---|
TargetedSelect<MainTableInfo> | Select object |
Type Parameters
Name | Description |
---|---|
MainTableInfo | TableInfo for which to create a select |
NewSelect<MainTableInfo>(params int[])
Returns a new instance of a targeted select (one that knows its main table, and has an instance of it)
Declaration
public static TargetedSelect<MainTableInfo> NewSelect<MainTableInfo>(params int[] primaryKey) where MainTableInfo : TableInfo
Parameters
Type | Name | Description |
---|---|---|
int[] | primaryKey | Array of one or more primary key values, for which an IN restriction is created |
Returns
Type | Description |
---|---|
TargetedSelect<MainTableInfo> | Select object |
Type Parameters
Name | Description |
---|---|
MainTableInfo | TableInfo for which to create a select |
NewUpdate()
Returns a new instance of the Update class.
Declaration
public static Update NewUpdate()
Returns
Type | Description |
---|---|
Update | a new instance of the Update class. |
NewUpdate(string)
Returns a new instance of the Update class.
Declaration
public static Update NewUpdate(string origin)
Parameters
Type | Name | Description |
---|---|---|
string | origin | This text is included - if possible - as an SQL comment in the generated SQL statement. It will usually be visible in database tracing tools, and the intention is to make it possible to identify the code that gave created a particular query. This has great "forensic" value when investigating performance or reverse-engineering the system. |
Returns
Type | Description |
---|---|
Update | a new instance of the Update class. |
Or(IEnumerable<Restriction>)
Combines the provided restriction-objects into one restriction using a logical OR. If no valid restrictions are provided, null will be returned.
Declaration
public static Restriction Or(this IEnumerable<Restriction> instance)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Restriction> | instance | An enumerable of Restriction. Can be null. |
Returns
Type | Description |
---|---|
Restriction | A new restriction based on the provided restriction-enumerable. |
Parameter(bool)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(bool parameter)
Parameters
Type | Name | Description |
---|---|---|
bool | parameter | bool value to be stored |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(bool, bool)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(bool parameter, bool useSqlParameter)
Parameters
Type | Name | Description |
---|---|---|
bool | parameter | bool value to be stored |
bool | useSqlParameter | If true, a sql parameter will be added for this parameter when creating the query, otherwise the value will be added directly to the query |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(DBNull)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(DBNull parameter)
Parameters
Type | Name | Description |
---|---|---|
DBNull | parameter | NULL value to be stored |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(DBNull, bool)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(DBNull parameter, bool useSqlParameter)
Parameters
Type | Name | Description |
---|---|---|
DBNull | parameter | NULL value to be stored |
bool | useSqlParameter | If true, a sql parameter will be added for this parameter when creating the query, otherwise the value will be added directly to the query |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(DateTime)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(DateTime parameter)
Parameters
Type | Name | Description |
---|---|---|
DateTime | parameter | DateTime value to be stored |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(DateTime, bool)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(DateTime parameter, bool useSqlParameter)
Parameters
Type | Name | Description |
---|---|---|
DateTime | parameter | DateTime value to be stored |
bool | useSqlParameter | If true, a sql parameter will be added for this parameter when creating the query, otherwise the value will be added directly to the query |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(double)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(double parameter)
Parameters
Type | Name | Description |
---|---|---|
double | parameter | double value to be stored |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(double, bool)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(double parameter, bool useSqlParameter)
Parameters
Type | Name | Description |
---|---|---|
double | parameter | double value to be stored |
bool | useSqlParameter | If true, a sql parameter will be added for this parameter when creating the query, otherwise the value will be added directly to the query |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(Stream)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(Stream parameter)
Parameters
Type | Name | Description |
---|---|---|
Stream | parameter | Stream to be stored |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(short, bool)
Declaration
public static Parameter Parameter(short parameter, bool useSqlParameter = true)
Parameters
Type | Name | Description |
---|---|---|
short | parameter | |
bool | useSqlParameter |
Returns
Type | Description |
---|---|
Parameter |
Parameter(int)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(int parameter)
Parameters
Type | Name | Description |
---|---|---|
int | parameter | signed integer value to be stored |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(int, bool)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(int parameter, bool useSqlParameter)
Parameters
Type | Name | Description |
---|---|---|
int | parameter | signed integer value to be stored |
bool | useSqlParameter | If true, a sql parameter will be added for this parameter when creating the query, otherwise the value will be added directly to the query |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(object)
Returns a new instance of the Parameter class based on the parameter provided.
Declaration
public static Parameter Parameter(object parameter)
Parameters
Type | Name | Description |
---|---|---|
object | parameter | The parameter. |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(object, FieldDataType)
Returns a new instance of the Parameter class,
Declaration
public static Parameter Parameter(object parameter, FieldDataType dataType)
Parameters
Type | Name | Description |
---|---|---|
object | parameter | object to be stored |
FieldDataType | dataType | Type of the data to be stored |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Remarks
The type-checking will be done in the different Dialect-classes.
Parameter(object, FieldDataType, bool)
Returns a new instance of the Parameter class,
Declaration
public static Parameter Parameter(object parameter, FieldDataType dataType, bool useSqlParameter)
Parameters
Type | Name | Description |
---|---|---|
object | parameter | object to be stored |
FieldDataType | dataType | Type of the data to be stored |
bool | useSqlParameter | If true, a sql parameter will be added for this parameter when creating the query, otherwise the value will be added directly to the query |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Remarks
The type-checking will be done in the different Dialect-classes.
Parameter(object, bool)
Returns a new instance of the Parameter class based on the parameter provided.
Declaration
public static Parameter Parameter(object parameter, bool useSqlParameter)
Parameters
Type | Name | Description |
---|---|---|
object | parameter | The parameter. |
bool | useSqlParameter | If true, a sql parameter will be added for this parameter when creating the query, otherwise the value will be added directly to the query |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(string)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(string parameter)
Parameters
Type | Name | Description |
---|---|---|
string | parameter | string value to be stored |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(string, bool)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(string parameter, bool useSqlParameter)
Parameters
Type | Name | Description |
---|---|---|
string | parameter | string value to be stored |
bool | useSqlParameter | If true, a sql parameter will be added for this parameter when creating the query, otherwise the value will be added directly to the query |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(uint)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(uint parameter)
Parameters
Type | Name | Description |
---|---|---|
uint | parameter | unsigned integer value to be stored |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |
Parameter(uint, bool)
Returns a new instance of the Parameter class.
Declaration
public static Parameter Parameter(uint parameter, bool useSqlParameter)
Parameters
Type | Name | Description |
---|---|---|
uint | parameter | unsigned integer value to be stored |
bool | useSqlParameter | If true, a sql parameter will be added for this parameter when creating the query, otherwise the value will be added directly to the query |
Returns
Type | Description |
---|---|
Parameter | a new instance of the Parameter class. |