QueryImpl Class
The default implementation of Query.
public sealed class QueryImpl : Query
- Inheritance
-
Query
Impl
- Implements
Constructors
Query |
The default implementation of Query. |
Methods
Select |
Description copied from interface: Query
|
Select<T>(string[]) |
Description copied from interface: Query
|
Delete |
Description copied from interface: Query
|
New |
Description copied from interface: Query
|
New |
Description copied from interface: Query
|
Insert<T>(T) |
Description copied from interface: Query
|
Insert |
Description copied from interface: Query
|
Select |
Description copied from interface: Query
|
Select |
Description copied from interface: Query
|
Column |
Description copied from interface: Query
|
Update<T>(string) |
Description copied from interface: Query
|
Equals(object) | (Inherited from object) |
GetHashCode() | (Inherited from object) |
GetType() | (Inherited from object) |
MemberwiseClone() | (Inherited from object) |
ToString() | (Inherited from object) |
Constructors Detail
QueryImpl(Siphon, MetadataBank)
The default implementation of Query.
public QueryImpl(Siphon siphon, MetadataBank bank)
Parameters
- siphon
- Siphon
The abstraction of the database connection.
- bank
-
Metadata
Bank
The cache for the reflection.
Methods Detail
SelectAllFrom<T>(string)
Description copied from interface: Query
Selects all columns of the specified table.
public SelectFrom<T> SelectAllFrom<T>(string alias)
Type Parameters
- T
-
notnull
Parameters
- alias
- string
Returns
Implements
Select<T>(string[])
Description copied from interface: Query
Gets the Query.Select<T>(string[]) object to select the specified columns of the specified table.
public Select<T> Select<T>(params string[] columns)
Type Parameters
- T
-
notnull
Parameters
- columns
- string[]
Returns
Implements
DeleteFrom<T>()
Description copied from interface: Query
Gets the Query.DeleteFrom<T>() object to delete the specified rows of the specified table.
public DeleteFrom<T> DeleteFrom<T>()
Type Parameters
- T
-
notnull
Returns
Implements
NewTables(Type[])
Description copied from interface: Query
Creates new tables.
public void NewTables(params Type[] tables)
Parameters
- tables
- Type[]
Implements
Remarks
Description copied from interface: Query
This method drops the tables if they exist and then creates them newly.
NewTables(IEnumerable<Type>)
Description copied from interface: Query
Creates new tables.
public void NewTables(IEnumerable<Type> allTables)
Parameters
- allTables
- IEnumerable<Type>
Implements
Remarks
Description copied from interface: Query
This method drops the tables if they exist and then creates them newly.
Insert<T>(T)
Description copied from interface: Query
Inserts a new row into the table.
public void Insert<T>(T row)
Type Parameters
- T
-
notnull
Parameters
- row
- T
Implements
InsertAndGetRowId<T>(T)
Description copied from interface: Query
Inserts a new row into the table and gets its ID.
public long InsertAndGetRowId<T>(T row)
Type Parameters
- T
-
notnull
Parameters
- row
- T
Returns
Implements
SelectUnique<T>(string, object)
Description copied from interface: Query
Gets the single row of the table in which the specified unique field matches the specified value.
public T SelectUnique<T>(string columnName, object value)
Type Parameters
- T
-
class
Parameters
- columnName
- string
- value
- object
Returns
Description copied from interface: Query
The row in which the field specified with
columnName
matches the specifiedvalue
if it exists,null
otherwise.
Implements
SelectAll<T>()
Description copied from interface: Query
Gets all the rows of the specified table.
public IEnumerable<T> SelectAll<T>()
Type Parameters
- T
-
notnull
Returns
Implements
Remarks
Description copied from interface: Query
The IEnumerable<T> object returned by this method is valid as long as the transaction is in progress. If you need access to it after the transaction, you must use something like the Enumerable.ToList<TSource>(IEnumerable<TSource>) method to get the list in the meantime and then use it afterward.
ColumnName<T>(string)
Description copied from interface: Query
Gets the column name associated with the specified parameter.
public string ColumnName<T>(string parameterName)
Type Parameters
- T
-
notnull
Parameters
- parameterName
- string
Returns
Implements
Update<T>(string)
Description copied from interface: Query
Gets the Update object to update the specified table.
public Update Update<T>(string alias)
Type Parameters
- T
-
notnull
Parameters
- alias
- string
Returns
Implements
Examples
Description copied from interface: Query
var kit = new TransactionKit( "update_example.db", m => Console.WriteLine(m())); var map = new Dictionary<string, object>() { ["$id"] = 2L, ["$newState"] = "Closed", }; kit.Execute(q => { q.Update<Issue>("i") .Set("state = $newState") .Where("i.id = $id") .Execute(map); });