I provide an ID in the route (".../api/mobile/registers/192" - 192 is ID) and the rest of params in the body of a PUT-request. How to bing them to a model with all the parameters? The problem is that the ID does not map, it is always 0:
[HttpPut("registers/{id}")]
public async Task ModifyPaymentRegister(PaymentRegisterModifyRequestVm model)
{
var result = await financeService.ModifyPaymentRegisterAsync(model, CurrentUserId.Value);
...
}
[BindProperties(SupportsGet = true)]
public class PaymentRegisterModifyRequestVm
{
/// <summary>
/// Идентификатор реестра
/// </summary>
[FromRoute]
public int Id { get; set; }
/// <summary>
/// Описание реестра
/// </summary>
[FromBody]
public string Description { get; set; }
/// <summary>
/// Тип модификации реестра
/// </summary>
[FromBody]
public PaymentModifyType ModifyType { get; set; }
}
