Files
2026-03-17 09:53:09 -05:00

20 lines
519 B
C#

using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace LCU.API.Internal.Operations.IncentiveApi.Extensions
{
public static class ModelStateMessages
{
public static List<string> GetErrorMessages(this ModelStateDictionary dictionary)
{
if (dictionary == null)
{
return new List<string>();
}
return dictionary.SelectMany(m => m.Value.Errors)
.Select(m => m.ErrorMessage)
.ToList();
}
}
}