Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Model State Errors - ASP.NET

RSS
Modified on Tue, Oct 09, 2018, 8:13 AM by Administrator Categorized as ASP·NET MVC
private string GetModelStateErrors(System.Web.Http.ModelBinding.ModelStateDictionary msd)
{
    var i = 0;
    var items = msd.Values.SelectMany(v => v.Errors.Select(ve => $"({++i}) {ve.Exception.Message}"));
    return string.Join(" ", items);
}

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.