Files
monorepo/LCU.API.Internal.FTP/LCU.Api.Internal.FTP/Extensions/ModelStateMessages.cs
T
2026-03-24 15:28:37 -05:00

17 lines
447 B
C#

using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace LCU.Api.Internal.FTP.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();
}
}
}