code
[HttpPost("add-car")]
public async Task<IActionResult> AddCarAsync([FromBody] AddCarInputDtos addCarInputDtos)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
}
code
code
public class AddCarInputDtos
{
public int? CodeParent { get; set; }
[Required(ErrorMessage = "CodeCarList parameter is mandatory.")]
public int? CodeCarList { get; set; }}
[EnumDataType(typeof(YesNoEnum), ErrorMessage = "YesNoEnum value doesn't exist within enum")]
public YesNoEnum? FeatureLoad { get; set; }
}
code
, когда я вызываю этот APIМетод с почтальоном в формате application / json и трассировки объекта кода имеет значение null и возвращает code
{
"$.featureLoad": [
"The JSON value could not be converted to System.Nullable`1[Jinavat.Backend.Api.Dtos.General.YesNoEnum]. Path: $.featureLoad | LineNumber: 0 | BytePositionInLine: 268."
]
}
code
, помогите мне решить эту проблему