i\'ve got a sign up wizard for new user registration. When I try to goto the 2nd page, I get validation errors because my User object hasn\'t been fully populated,
I had a reference entity that wasn't supposed to be validated.
Removed it from validation at the beginning of the action:
[HttpPost]
public async Task Post([FromBody] Contact contact)
{
var skipped = ModelState.Keys.Where(key => key.StartsWith(nameof(Contact.Portfolios)));
foreach (var key in skipped)
ModelState.Remove(key);
//ModelState doesn't include anything about Portfolios which we're not concerned with
if (!ModelState.IsValid)
return BadRequest(ModelState);
//Rest of action
}