Files
monorepo/LCU.API.Internal.ArchiverApi/LCU.Api.Internal.ArchiverApi/Extensions/ModelStateMessages.cs
T
2026-03-17 10:03:23 -05:00

17 lines
455 B
C#

using Microsoft.AspNetCore.Mvc.ModelBinding;
using System.Collections.Generic;
using System.Linq;
namespace LCU.Api.Internal.ArchiverApi.Extensions
{
public static class ModelStateMessages
{
public static List<string> GetErrorMessages(this ModelStateDictionary dictionary)
{
return dictionary.SelectMany(m => m.Value.Errors)
.Select(m => m.ErrorMessage)
.ToList();
}
}
}