Dharmang
Dharmang
CC#
Created by Dharmang on 12/13/2023 in #help
Web API - Get Payload in body as well as the uploaded File using Ardalis Endpoints
No description
6 replies
CC#
Created by Dharmang on 11/24/2023 in #help
WinUI3 Learning Resources
Hi, I am new to winui3 using C# and didn't find any helpful resources online to learn the basics. It seems that people coming from winforms and wpf already know these things which might be why people are not asking for any tutorials but I don't want/need to learn the older frameworks in order to use winui3 right? Any help is appreciated!
1 replies
CC#
Created by Dharmang on 11/20/2023 in #help
Trying to use Microsoft.Kiota namespace but not found when importing
No description
1 replies
CC#
Created by Dharmang on 10/20/2023 in #help
How can I create an ardalis put endpoint request with id in route and payload in body?
Sample:
public class UpdateById : EndpointBaseAsync.WithRequest<DocumentTemplateUpdateByIdRequest>.WithActionResult<int>
{
private readonly IDocumentTemplateService _documentTemplateService;

public UpdateById(IDocumentTemplateService documentTemplateService)
{
_documentTemplateService = documentTemplateService;
}

[HttpPut("api/document-templates/{id}")]
[SwaggerOperation(
Description = "Update a Document Template by id",
OperationId = "DocumentTemplates.UpdateById",
Tags = new[] { "DocumentTemplate" }
)]
public override async Task<ActionResult<int>> HandleAsync([FromRoute] int id, [FromBody] DocumentTemplateUpdateByIdRequest request, CancellationToken cancellationToken = default)
{
var result = await _documentTemplateService.UpdateDocumentTemplateByIdAsync(request);
return result.ToActionResult(this);
}
}
public class UpdateById : EndpointBaseAsync.WithRequest<DocumentTemplateUpdateByIdRequest>.WithActionResult<int>
{
private readonly IDocumentTemplateService _documentTemplateService;

public UpdateById(IDocumentTemplateService documentTemplateService)
{
_documentTemplateService = documentTemplateService;
}

[HttpPut("api/document-templates/{id}")]
[SwaggerOperation(
Description = "Update a Document Template by id",
OperationId = "DocumentTemplates.UpdateById",
Tags = new[] { "DocumentTemplate" }
)]
public override async Task<ActionResult<int>> HandleAsync([FromRoute] int id, [FromBody] DocumentTemplateUpdateByIdRequest request, CancellationToken cancellationToken = default)
{
var result = await _documentTemplateService.UpdateDocumentTemplateByIdAsync(request);
return result.ToActionResult(this);
}
}
2 replies