Get the "Key" for a strongly typed model in the controller

Viewed 1551

So I am trying to do get the key for a model object in the controller so that I can add a AddModelError to it.

In my view I use

@Html.ValidationMessageFor(model => model.Email)

Whats the equivalent code to get the Key name to add in the controller so it attaches to this ValidationMessage.

2 Answers
Related