public async Task <IActionResult> GetContentsPost(string app, string name, [FromBody] QueryDto query) { var schema = await contentQuery.GetSchemaOrThrowAsync(Context, name); var contents = await contentQuery.QueryAsync(Context, name, query?.ToQuery() ?? Q.Empty); var response = Deferred.AsyncResponse(async() => { return(await ContentsDto.FromContentsAsync(contents, Context, this, schema, contentWorkflow)); }); return(Ok(response)); }
public async Task <IActionResult> GetContents(string app, string name, [FromQuery] string?ids = null, [FromQuery] string?q = null) { var schema = await contentQuery.GetSchemaOrThrowAsync(Context, name); var contents = await contentQuery.QueryAsync(Context, name, CreateQuery(ids, q)); var response = Deferred.AsyncResponse(async() => { return(await ContentsDto.FromContentsAsync(contents, Context, this, schema, contentWorkflow)); }); return(Ok(response)); }
public async Task <IActionResult> GetContents(string app, string name, [FromQuery] string?ids = null, [FromQuery] string?q = null) { var schema = await contentQuery.GetSchemaOrThrowAsync(Context, name); var contents = await contentQuery.QueryAsync(Context, name, Q.Empty .WithIds(ids) .WithJsonQuery(q) .WithODataQuery(Request.QueryString.ToString())); var response = Deferred.AsyncResponse(async() => { return(await ContentsDto.FromContentsAsync(contents, Context, this, schema, contentWorkflow)); }); return(Ok(response)); }
public async Task <IActionResult> GetAllContents(string app, [FromQuery] string ids) { var contents = await contentQuery.QueryAsync(Context, Q.Empty.WithIds(ids).Ids); var response = Deferred.AsyncResponse(() => { return(ContentsDto.FromContentsAsync(contents, Context, this, null, contentWorkflow)); }); if (ShouldProvideSurrogateKeys(contents)) { Response.Headers["Surrogate-Key"] = contents.ToSurrogateKeys(); } Response.Headers[HeaderNames.ETag] = contents.ToEtag(); return(Ok(response)); }
public async Task <IActionResult> GetContents(string app, string name, [FromQuery] string ids = null) { var schema = await contentQuery.GetSchemaOrThrowAsync(Context, name); var contents = await contentQuery.QueryAsync(Context, name, Q.Empty.WithIds(ids).WithODataQuery(Request.QueryString.ToString())); var response = Deferred.AsyncResponse(async() => { return(await ContentsDto.FromContentsAsync(contents, Context, this, schema, contentWorkflow)); }); if (ShouldProvideSurrogateKeys(contents)) { Response.Headers["Surrogate-Key"] = contents.ToSurrogateKeys(); } Response.Headers[HeaderNames.ETag] = contents.ToEtag(); return(Ok(response)); }