17 lines
455 B
C#
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();
|
|
}
|
|
}
|
|
}
|