I have a situation where I want to be in the model was required only one field of the two.
public int AutoId { get; set; }
public virtual Auto Auto { get; set; }
[StringLength(17, MinimumLength = 17)]
[NotMapped]
public String VIN { get; set; }
If someone entered the vin, it is converted in the controller on the AutoID. How to force the controller to something like this work?
public ActionResult Create(Ogloszenie ogloszenie) {
information.AutoId = 1;
if (ModelState.IsValid)
{
...
}..