Dachi
Dachi
CC#
Created by Dachi on 6/19/2024 in #help
✅ Api request matching issue
i have this method
public async Task<ActionResult<ApiServiceResponse<CommissionDto>>> AutomaticOperationSave(
[FromBody] AutomaticOperation request, CancellationToken cancellationToken)
public async Task<ActionResult<ApiServiceResponse<CommissionDto>>> AutomaticOperationSave(
[FromBody] AutomaticOperation request, CancellationToken cancellationToken)
and then api respons comes it cannot match with the AutomaticOperation. that class extends class operation that looks like this
[DisplayName("ოპერაცია")]
public class Operation : JDateTimesAndSelectable.
[DisplayName("ოპერაცია")]
public class Operation : JDateTimesAndSelectable.
and error looks like this:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2d09e0cccda2990b5453fa03ae4749e6-03b1d5d212e40e2d-00",
"errors": {
"request": [
"The ოპერაცია field is required."
],
"$.OperationDate": [
"The JSON value could not be converted to System.DateTime. Path: $.OperationDate | LineNumber: 19 | BytePositionInLine: 42."
]
}
}
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2d09e0cccda2990b5453fa03ae4749e6-03b1d5d212e40e2d-00",
"errors": {
"request": [
"The ოპერაცია field is required."
],
"$.OperationDate": [
"The JSON value could not be converted to System.DateTime. Path: $.OperationDate | LineNumber: 19 | BytePositionInLine: 42."
]
}
}
Can you please help me?
37 replies
CC#
Created by Dachi on 4/9/2024 in #help
✅ How Scope lifetime works
I have a web api where when requesting a create endpoint, it afterwards sends an email to that person about that creation. I send email with html and for it i first check if that html was read before and then store it in a variable to improve efficiency (to not read every single time). I have that as AddTransiant, which means that besides i store that in a variable, it still has to be lost, because of a lifetime. But it doesn't, it still knows that. Can someone explain how that lifetime works?
28 replies
CC#
Created by Dachi on 4/7/2024 in #help
✅ Authorization in ASP.NET Web Api
[Authorize("MyApiUserPolicy", AuthenticationSchemes = "Bearer")] How exactly does it check provided token if it is valid or not? Like does it generate similar token and based on provided token it just compares it or there is something else going on?
236 replies
CC#
Created by Dachi on 2/18/2024 in #help
Db design
No description
159 replies
CC#
Created by Dachi on 12/3/2023 in #help
✅ Threads in c#
I am wondering if it is possible to kill main thread while other thread is still being executed? Cuz as i know additional threads are being created in the main thread thus killing main threads would mean to stop executing the code but in the screen shot it behaves differently.
28 replies
CC#
Created by Dachi on 11/22/2023 in #help
I am trying to establish SQL connection but fails
Error is somehow related to globalization.
21 replies