MVC Core – How to render TimeSpan with TotalHours
I’m working with TimeSpan in my model. This TimeSpan represent a duration upper than 24hours (ex. 160 hours). I’m need to display this duration in my View (reprensenting TotalHours and Minutes : “160:00”). I’m need to display it in a editfor ou textboxfor to allow user to manipulate the value.
415 Unsupported Media Type – POST http://localhost:5229/api/Login/Register 415 (Unsupported Media Type)
I am designing a Login page. This page contains Login and Register operations. Login works without any problems. And since the login is successful, it redirects to Home/index. But when I create a record in Register ;
{
“type”: “https://tools.ietf.org/html/rfc7231#section-6.5.13”,
“title”: “Unsupported Media Type”,
“status”: 415,
“traceId”: “00-cc6baa3aa36de0096173305b5da0fc3c-a1c304fae207b3f0-00”
}
I am encountering such an error. When I put a break point in my Login Controllers, I noticed that the request never came here. Neither foody nor the loginController in foodyService receives the request.
Allow both Query OR Route model binding with MVC API
I’ve got an HttpGet on an API method with primitive parameters and would like to provide the option of passing parameters via the query OR route. I’ve just trashed half a day building various custom binders and such trying to figure this out to no avail.
The ID is not taken from another table
I want to write an ID in carID from another table, the data in it is filled in, everything is fine with it, carId = el.clothes.IdClothes