I am trying to create model, which I could use for Body and Route at once. I found solution here, but I would like to move it little bit further. Not using extra "body" class, but include everything in one class. I tried this, but it does not work.
public class Car
{
[Required, FromRoute]
public int CarId { get; set; }
[Required, FromBody]
public string UpdatedBy { get; set; }
[Required, FromBody]
public string Colour { get; set; }
[Required, FromBody]
public string Wheels { get; set; }
[Required, FromBody]
public DateTime UpdatedDate { get; set; }
}
I am trying to use it as input for PUT method:
public async Task<IActionResult> CarUpdate(Car car, CancellationToken cancellationToken)
But I would like to have it like this:
Is it possible? Thank you.

