Interface ITypedQuery
Query object from GetQuery(string?, NoParamOrder, IDataSourceLinkable?, object?) an App in Typed mode, with quick get-and-convert-helpers such as GetAll
or GetOne
.
[WorkInProgressApi("Still WIP")]
public interface ITypedQuery : IDataSource, IDataSourceLinkable, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheKey, ICacheExpiring, ITimestamped, IHasLog
- Inherited Members
Remarks
WIP v20
Methods
GetAll<T>(NoParamOrder, string?, bool)
Get all data from the app of the specified type in a stream with the same name (or "Default"). It will detect the expected stream name based on the name of the class used.
So in most cases you will not add any parameters except for the type parameter T
.
This is usually a type of your AppCode.Data
namespace.
IEnumerable<T>? GetAll<T>(NoParamOrder protector = default, string? typeName = null, bool nullIfNotFound = false) where T : class, ICanWrapData
Parameters
protector
NoParamOrdertypeName
stringoptional type name which is used as the stream name when retrieving the data, as each stream contains entities of one type.
nullIfNotFound
boolif set, will return null if the type doesn't exist - default is empty list.
Returns
- IEnumerable<T>
Type Parameters
T
The type to convert to - usually inheriting
Custom.Data.CustomItem
orCustomModel
Remarks
WIP in v20.00
GetOne<T>(Guid, NoParamOrder, bool)
Get a single item from the query with the specified GUID.
T? GetOne<T>(Guid guid, NoParamOrder protector = default, bool skipTypeCheck = false) where T : class, ICanWrapData
Parameters
guid
Guidthe ID as GUID
protector
NoParamOrderskipTypeCheck
boolallow get even if the Content-Type of the item with the ID doesn't match the type specified in the parameter T
Returns
- T
Type Parameters
T
The type to convert to - usually inheriting
Custom.Data.CustomItem
orCustomModel
Remarks
WIP in v20.00
GetOne<T>(int, NoParamOrder, bool)
Get a single item from the query with the specified ID.
T? GetOne<T>(int id, NoParamOrder protector = default, bool skipTypeCheck = false) where T : class, ICanWrapData
Parameters
id
intthe ID as an int
protector
NoParamOrderskipTypeCheck
boolallow get even if the Content-Type of the item with the ID doesn't match the type specified in the parameter T
Returns
- T
Type Parameters
T
The type to convert to - usually inheriting
Custom.Data.CustomItem
orCustomModel
Remarks
WIP in v20.00