Interface ISelectionQuery<T>
Interface which describe query for calling selects methods.
Inherited Members
Namespace: Kros.KORM.Query
Assembly: Kros.KORM.dll
Syntax
public interface ISelectionQuery<T> : IFromQuery<T>, IProjectionQuery<T>, IQueryBase<T>, IOrderedQueryable<T>, IQueryable<T>, IEnumerable<T>, IOrderedQueryable, IQueryable, IEnumerable
Type Parameters
Name | Description |
---|---|
T | Entity type. |
Methods
Select(String)
Add select part to sql.
Declaration
IFromQuery<T> Select(string selectPart)
Parameters
Type | Name | Description |
---|---|---|
System.String | selectPart | The columns for select clausule. (Separate by ,) |
Returns
Type | Description |
---|---|
IFromQuery<T> | Query for enumerable models. |
Remarks
When Select
method is not call, query take columns by T model.
Examples
var people = database.Query<Person>().Select("Id, FirstName");
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | if |
Select(String[])
Add columns to sql.
Declaration
IFromQuery<T> Select(params string[] columns)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | columns | The columns for select clausule. |
Returns
Type | Description |
---|---|
IFromQuery<T> | Query for enumerable models. |
Remarks
When Select method is not call, query take columns by T model.
Examples
var people = database.Query<Person>().Select("Id", "FirstName");
Select<TResult>(Func<T, TResult>)
Add columns to sql
Declaration
IFromQuery<T> Select<TResult>(Func<T, TResult> selector)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, TResult> | selector | The selector. |
Returns
Type | Description |
---|---|
IFromQuery<T> | Query for enumerable models. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the result. |
Remarks
When Select
method is not call, query take columns by T model.
Examples
var people = database.Query<Person>().Select(p => new { p.Id, p.FirstName });
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | if |
See Also
IFromQuery<T>