Is there a way to make a data annotation conditional? I have a table Party where I store both organisations and persons. If I\'m adding an organisation I don\'t w
Party
In Controller you can check like this: Before if (ModelState.IsValid)
if (model.party_type == 'p') { this.ModelState.Remove("surname"); }