Files
server/src/Core/Utilities/ModelStateExtensions.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
401 B
C#
Raw Normal View History

using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace Bit.Core.Utilities;
public static class ModelStateExtensions
{
public static string GetErrorMessage(this ModelStateDictionary modelState)
{
var errors = modelState.Values
.SelectMany(v => v.Errors)
.Select(e => e.ErrorMessage)
.ToList();
return string.Join("; ", errors);
}
}