Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix sample for using Compiled Query for WriteArray with Parameter #2898

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/IssueService/Controllers/IssueController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#region sample_write_single_document_by_id_to_httpresponse

[HttpGet("/issue/{issueId}")]
public Task Get(Guid issueId, [FromServices] IQuerySession session, [FromQuery] string? sc = null)

Check warning on line 42 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 42 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 42 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
// This "streams" the raw JSON to the HttpResponse
// w/o ever having to read the full JSON string or
Expand All @@ -57,7 +57,7 @@
#region sample_use_linq_to_write_single_document_to_httpcontext

[HttpGet("/issue2/{issueId}")]
public Task Get2(Guid issueId, [FromServices] IQuerySession session, [FromQuery] string? sc = null)

Check warning on line 60 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 60 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 60 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
return sc is null
? session.Query<Issue>().Where(x => x.Id == issueId)
Expand All @@ -71,12 +71,12 @@
#region sample_write_single_document_to_httpcontext_with_compiled_query

[HttpGet("/issue3/{issueId}")]
public Task Get3(Guid issueId, [FromServices] IQuerySession session, [FromQuery] string? sc = null)

Check warning on line 74 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 74 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 74 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
return sc is null
? session.Query<Issue>().Where(x => x.Id == issueId)
? session.Query<Issue>(new IssueById() { Id = issueId })

Check failure on line 77 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

Argument 1: cannot convert from 'IssueService.Controllers.IssueById' to 'string'

Check failure on line 77 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

Argument 1: cannot convert from 'IssueService.Controllers.IssueById' to 'string'

Check failure on line 77 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

Argument 1: cannot convert from 'IssueService.Controllers.IssueById' to 'string'

Check failure on line 77 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

Argument 1: cannot convert from 'IssueService.Controllers.IssueById' to 'string'

Check failure on line 77 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

Argument 1: cannot convert from 'IssueService.Controllers.IssueById' to 'string'

Check failure on line 77 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

Argument 1: cannot convert from 'IssueService.Controllers.IssueById' to 'string'
.WriteSingle(HttpContext)
: session.Query<Issue>().Where(x => x.Id == issueId)
: session.Query<Issue>(new IssueById() { Id = issueId })

Check failure on line 79 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

Argument 1: cannot convert from 'IssueService.Controllers.IssueById' to 'string'

Check failure on line 79 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

Argument 1: cannot convert from 'IssueService.Controllers.IssueById' to 'string'

Check failure on line 79 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

Argument 1: cannot convert from 'IssueService.Controllers.IssueById' to 'string'

Check failure on line 79 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

Argument 1: cannot convert from 'IssueService.Controllers.IssueById' to 'string'

Check failure on line 79 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

Argument 1: cannot convert from 'IssueService.Controllers.IssueById' to 'string'

Check failure on line 79 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

Argument 1: cannot convert from 'IssueService.Controllers.IssueById' to 'string'
.WriteSingle(HttpContext, onFoundStatus: int.Parse(sc));
}

Expand All @@ -86,7 +86,7 @@
#region sample_writing_multiple_documents_to_httpcontext

[HttpGet("/issue/open")]
public Task OpenIssues([FromServices] IQuerySession session, [FromQuery] string? sc = null)

Check warning on line 89 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 89 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 89 in src/IssueService/Controllers/IssueController.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
// This "streams" the raw JSON to the HttpResponse
// w/o ever having to read the full JSON string or
Expand Down
Loading