Validating non-nullable property in Body as Required - AspNetCore 3.1
问题 I am trying to validate that if a property / field is completely left off on a request that the ModelState is invalid and a BadRequest is sent back to the client, however I am struggling with handling of non-nullable types in request bodies. Works for nullable types [Required] public string NullableString { get; set; } Works for non-nullable and nullable parameters public IActionResult RequiredNonNullableIntQueryString([Required]int nonNullableInt) public IActionResult