public ObjectResult ModelStateTestPost2([Required] int id, [FromBody] ValidationMaxRelativeModel inputModel) { if (this.TryValidateModel(inputModel)) { return(Ok(inputModel)); } return(BadRequest(ModelState)); }
public ActionResult RelativeDateClientPost(int?id) { if (!id.HasValue) { return(RedirectToAction("Index")); } var model = ValidationMaxRelativeModel.GetModell(id.Value); this.TryUpdateModel(model); return(View(model)); }
public ActionResult RelativeDateClient() { return(View(ValidationMaxRelativeModel.GetModell(1))); }