title: Display Model state Errors in View?
body: <p>How can I display <code>ModelState</code> in my View? I have the following code for validation but I am not able to display Modelstate error in my View. </p>
  
  <p>I have this conditions my action:</p>
  
  <pre><code>        if (!ModelState.IsValid)
              return BadRequest(ModelState.Values.SelectMany(v =&gt; v.Errors).Select(error =&gt; error.ErrorMessage));
  
       else if (ModelState.IsValid)
              {         
              if (updatedProduct.ProductSRDate.Value &gt; DateTime.Now)
                  ModelState.AddModelError("ProductSRDate", " Date must be current date or in the past.");               
              var PrjEditMode = await ProductService.GetProductsbyId(id);
              var editMode = Mapper.Map&lt;ProductDetails&gt;(PrjEditMode);
              return View(editMode);
          }
  </code></pre>
  
  <p>In View I have Validation Summary as: </p>
  
  <pre><code>@Html.ValidationSummary(false, "", new { @class = "text-danger" })
  </code></pre>
  
  <p>But it only display <code>Date must be current date or in the past.</code> when there is a nullable field it display `Date must be current date or in the past.</p>
  
  <p><code>0   "The value '' is invalid."</code>.</p>
  
  <p><img src="https://i.stack.imgur.com/UHIYn.png" alt="enter image description here"></p>