ListApiResource<TData, TId> constructor
ListApiResource<TData, TId> (
- RoutePattern path,
- TransferBean<
TData> bean, { - String idParam = 'id',
- bool allowPatch = true,
- bool allowPost = true,
- bool allowDelete = true,
Implementation
ListApiResource(RoutePattern path, TransferBean<TData> bean,
{this.idParam = 'id',
bool allowPatch = true,
bool allowPost = true,
bool allowDelete = true})
: super._(path, bean, allowPatch, allowPost, allowDelete) {
if (!path.containsParam(idParam)) {
throw ApiError(
'ApiResource path does not contain the id placeholder: $idParam');
}
if (TId != String && TId != int) {
throw ApiError('ApiResource only allows int or String as id type.');
}
}