Skip to main content

AutoQuery

Assembly: ServiceStack.Server.dll
View Source
Declaration
public class AutoQuery : object, IAutoQueryDb, IAutoCrudDb, IAutoQueryOptions

Properties

IgnoreCrudProperties

View Source
Declaration
public static HashSet<string> IgnoreCrudProperties { get; }

IncludeCrudProperties

View Source
Declaration
public static HashSet<string> IncludeCrudProperties { get; set; }

MaxLimit

View Source
Declaration
public int? MaxLimit { get; set; }

IncludeTotal

View Source
Declaration
public bool IncludeTotal { get; set; }

EnableUntypedQueries

View Source
Declaration
public bool EnableUntypedQueries { get; set; }

EnableSqlFilters

View Source
Declaration
public bool EnableSqlFilters { get; set; }

OrderByPrimaryKeyOnLimitQuery

View Source
Declaration
public bool OrderByPrimaryKeyOnLimitQuery { get; set; }

RequiredRoleForRawSqlFilters

View Source
Declaration
public string RequiredRoleForRawSqlFilters { get; set; }

IgnoreProperties

View Source
Declaration
public HashSet<string> IgnoreProperties { get; set; }

IllegalSqlFragmentTokens

View Source
Declaration
public HashSet<string> IllegalSqlFragmentTokens { get; set; }

StartsWithConventions

View Source
Declaration
public Dictionary<string, QueryDbFieldAttribute> StartsWithConventions { get; set; }

EndsWithConventions

View Source
Declaration
public Dictionary<string, QueryDbFieldAttribute> EndsWithConventions { get; set; }

UseNamedConnection

View Source
Declaration
public string UseNamedConnection { get; set; }

GlobalQueryFilter

View Source
Declaration
public QueryFilterDelegate GlobalQueryFilter { get; set; }

QueryFilters

View Source
Declaration
public Dictionary<Type, QueryFilterDelegate> QueryFilters { get; set; }

ResponseFilters

View Source
Declaration
public List<Action<QueryDbFilterContext>> ResponseFilters { get; set; }

Methods

Create<Table>(ICreateDb<Table>, IRequest, IDbConnection)

View Source
Declaration
public object Create<Table>(ICreateDb<Table> dto, IRequest req, IDbConnection db = null)
Returns

System.Object

Parameters
TypeName
ServiceStack.ICreateDb<Table>dto
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • Table

CreateAsync<Table>(ICreateDb<Table>, IRequest, IDbConnection)

View Source
Declaration
public async Task<object> CreateAsync<Table>(ICreateDb<Table> dto, IRequest req, IDbConnection db = null)
Returns

Task<System.Object>

Parameters
TypeName
ServiceStack.ICreateDb<Table>dto
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • Table

Update<Table>(IUpdateDb<Table>, IRequest, IDbConnection)

View Source
Declaration
public object Update<Table>(IUpdateDb<Table> dto, IRequest req, IDbConnection db = null)
Returns

System.Object

Parameters
TypeName
ServiceStack.IUpdateDb<Table>dto
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • Table

UpdateAsync<Table>(IUpdateDb<Table>, IRequest, IDbConnection)

View Source
Declaration
public Task<object> UpdateAsync<Table>(IUpdateDb<Table> dto, IRequest req, IDbConnection db = null)
Returns

Task<System.Object>

Parameters
TypeName
ServiceStack.IUpdateDb<Table>dto
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • Table

Patch<Table>(IPatchDb<Table>, IRequest, IDbConnection)

View Source
Declaration
public object Patch<Table>(IPatchDb<Table> dto, IRequest req, IDbConnection db = null)
Returns

System.Object

Parameters
TypeName
ServiceStack.IPatchDb<Table>dto
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • Table

PatchAsync<Table>(IPatchDb<Table>, IRequest, IDbConnection)

View Source
Declaration
public Task<object> PatchAsync<Table>(IPatchDb<Table> dto, IRequest req, IDbConnection db = null)
Returns

Task<System.Object>

Parameters
TypeName
ServiceStack.IPatchDb<Table>dto
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • Table

PartialUpdate<Table>(Object, IRequest, IDbConnection)

View Source
Declaration
public object PartialUpdate<Table>(object dto, IRequest req, IDbConnection db = null)
Returns

System.Object

Parameters
TypeName
System.Objectdto
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • Table

PartialUpdateAsync<Table>(Object, IRequest, IDbConnection)

View Source
Declaration
public Task<object> PartialUpdateAsync<Table>(object dto, IRequest req, IDbConnection db = null)
Returns

Task<System.Object>

Parameters
TypeName
System.Objectdto
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • Table

Delete<Table>(IDeleteDb<Table>, IRequest, IDbConnection)

View Source
Declaration
public object Delete<Table>(IDeleteDb<Table> dto, IRequest req, IDbConnection db = null)
Returns

System.Object

Parameters
TypeName
ServiceStack.IDeleteDb<Table>dto
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • Table

DeleteAsync<Table>(IDeleteDb<Table>, IRequest, IDbConnection)

View Source
Declaration
public async Task<object> DeleteAsync<Table>(IDeleteDb<Table> dto, IRequest req, IDbConnection db = null)
Returns

Task<System.Object>

Parameters
TypeName
ServiceStack.IDeleteDb<Table>dto
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • Table

Save<Table>(ISaveDb<Table>, IRequest, IDbConnection)

View Source
Declaration
public object Save<Table>(ISaveDb<Table> dto, IRequest req, IDbConnection db = null)
Returns

System.Object

Parameters
TypeName
ServiceStack.ISaveDb<Table>dto
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • Table

SaveAsync<Table>(ISaveDb<Table>, IRequest, IDbConnection)

View Source
Declaration
public async Task<object> SaveAsync<Table>(ISaveDb<Table> dto, IRequest req, IDbConnection db = null)
Returns

Task<System.Object>

Parameters
TypeName
ServiceStack.ISaveDb<Table>dto
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • Table

GetFromType(Type)

View Source
Declaration
public Type GetFromType(Type requestDtoType)
Returns

Type

Parameters
TypeName
TyperequestDtoType

GetTypedQuery(Type, Type)

View Source
Declaration
public ITypedQuery GetTypedQuery(Type dtoType, Type fromType)
Returns

ServiceStack.ITypedQuery

Parameters
TypeName
TypedtoType
TypefromType

Filter<From>(ISqlExpression, IQueryDb, IRequest)

View Source
Declaration
public SqlExpression<From> Filter<From>(ISqlExpression q, IQueryDb dto, IRequest req)
Returns

ServiceStack.OrmLite.SqlExpression<T>

Parameters
TypeName
ServiceStack.OrmLite.ISqlExpressionq
ServiceStack.IQueryDbdto
ServiceStack.Web.IRequestreq
Type Parameters
  • From

Filter(ISqlExpression, IQueryDb, IRequest)

View Source
Declaration
public ISqlExpression Filter(ISqlExpression q, IQueryDb dto, IRequest req)
Returns

ServiceStack.OrmLite.ISqlExpression

Parameters
TypeName
ServiceStack.OrmLite.ISqlExpressionq
ServiceStack.IQueryDbdto
ServiceStack.Web.IRequestreq

ResponseFilter<From, Into>(IDbConnection, QueryResponse<Into>, SqlExpression<From>, IQueryDb)

View Source
Declaration
public QueryResponse<Into> ResponseFilter<From, Into>(IDbConnection db, QueryResponse<Into> response, SqlExpression<From> expr, IQueryDb dto)
Returns

ServiceStack.QueryResponse<T>

Parameters
TypeName
IDbConnectiondb
ServiceStack.QueryResponse<T>response
ServiceStack.OrmLite.SqlExpression<T>expr
ServiceStack.IQueryDbdto
Type Parameters
  • From
  • Into

GetDbNamedConnection(Type, IRequest)

View Source
Declaration
public string GetDbNamedConnection(Type fromType, IRequest req = null)
Returns

System.String

Parameters
TypeName
TypefromType
ServiceStack.Web.IRequestreq

GetDb<From>(IRequest)

View Source
Declaration
public IDbConnection GetDb<From>(IRequest req = null)
Returns

IDbConnection

Parameters
TypeName
ServiceStack.Web.IRequestreq
Type Parameters
  • From

GetDb(Type, IRequest)

View Source
Declaration
public IDbConnection GetDb(Type fromType, IRequest req = null)
Returns

IDbConnection

Parameters
TypeName
TypefromType
ServiceStack.Web.IRequestreq

CreateQuery<From>(IQueryDb<From>, Dictionary<String, String>, IRequest, IDbConnection)

View Source
Declaration
public SqlExpression<From> CreateQuery<From>(IQueryDb<From> dto, Dictionary<string, string> dynamicParams, IRequest req = null, IDbConnection db = null)
Returns

ServiceStack.OrmLite.SqlExpression<T>

Parameters
TypeName
ServiceStack.IQueryDb<From>dto
Dictionary<System.String,System.String>dynamicParams
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • From

Execute<From>(IQueryDb<From>, SqlExpression<From>, IRequest, IDbConnection)

View Source
Declaration
public QueryResponse<From> Execute<From>(IQueryDb<From> model, SqlExpression<From> query, IRequest req = null, IDbConnection db = null)
Returns

ServiceStack.QueryResponse<T>

Parameters
TypeName
ServiceStack.IQueryDb<From>model
ServiceStack.OrmLite.SqlExpression<T>query
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • From

ExecuteAsync<From>(IQueryDb<From>, SqlExpression<From>, IRequest, IDbConnection)

View Source
Declaration
public async Task<QueryResponse<From>> ExecuteAsync<From>(IQueryDb<From> model, SqlExpression<From> query, IRequest req = null, IDbConnection db = null)
Returns

Task<ServiceStack.QueryResponse<<From>>>

Parameters
TypeName
ServiceStack.IQueryDb<From>model
ServiceStack.OrmLite.SqlExpression<T>query
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • From

CreateQuery<From, Into>(IQueryDb<From, Into>, Dictionary<String, String>, IRequest, IDbConnection)

View Source
Declaration
public SqlExpression<From> CreateQuery<From, Into>(IQueryDb<From, Into> dto, Dictionary<string, string> dynamicParams, IRequest req = null, IDbConnection db = null)
Returns

ServiceStack.OrmLite.SqlExpression<T>

Parameters
TypeName
ServiceStack.IQueryDb<From>dto
Dictionary<System.String,System.String>dynamicParams
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • From
  • Into

Execute<From, Into>(IQueryDb<From, Into>, SqlExpression<From>, IRequest, IDbConnection)

View Source
Declaration
public QueryResponse<Into> Execute<From, Into>(IQueryDb<From, Into> model, SqlExpression<From> query, IRequest req = null, IDbConnection db = null)
Returns

ServiceStack.QueryResponse<T>

Parameters
TypeName
ServiceStack.IQueryDb<From>model
ServiceStack.OrmLite.SqlExpression<T>query
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • From
  • Into

ExecuteAsync<From, Into>(IQueryDb<From, Into>, SqlExpression<From>, IRequest, IDbConnection)

View Source
Declaration
public async Task<QueryResponse<Into>> ExecuteAsync<From, Into>(IQueryDb<From, Into> model, SqlExpression<From> query, IRequest req = null, IDbConnection db = null)
Returns

Task<ServiceStack.QueryResponse<<Into>>>

Parameters
TypeName
ServiceStack.IQueryDb<From>model
ServiceStack.OrmLite.SqlExpression<T>query
ServiceStack.Web.IRequestreq
IDbConnectiondb
Type Parameters
  • From
  • Into

CreateQuery(IQueryDb, Dictionary<String, String>, IRequest, IDbConnection)

View Source
Declaration
public ISqlExpression CreateQuery(IQueryDb requestDto, Dictionary<string, string> dynamicParams, IRequest req = null, IDbConnection db = null)
Returns

ServiceStack.OrmLite.ISqlExpression

Parameters
TypeName
ServiceStack.IQueryDbrequestDto
Dictionary<System.String,System.String>dynamicParams
ServiceStack.Web.IRequestreq
IDbConnectiondb

Execute(IQueryDb, ISqlExpression, IDbConnection)

View Source
Declaration
public IQueryResponse Execute(IQueryDb request, ISqlExpression q, IDbConnection db)
Returns

ServiceStack.IQueryResponse

Parameters
TypeName
ServiceStack.IQueryDbrequest
ServiceStack.OrmLite.ISqlExpressionq
IDbConnectiondb

ExecuteAsync(IQueryDb, ISqlExpression, IDbConnection)

View Source
Declaration
public Task<IQueryResponse> ExecuteAsync(IQueryDb request, ISqlExpression q, IDbConnection db)
Returns

Task<ServiceStack.IQueryResponse>

Parameters
TypeName
ServiceStack.IQueryDbrequest
ServiceStack.OrmLite.ISqlExpressionq
IDbConnectiondb

Implements