Hinzufügen von IEnumerable-Überladungen für Message- und Notice-Methoden in DTOExtensions.

This commit is contained in:
Developer 02 2024-05-16 16:12:51 +02:00
parent b71c778a4d
commit 0138fb5166

View File

@ -17,13 +17,19 @@ namespace DigitalData.Core.DTO
return result; return result;
} }
public static T Message<T>(this T result, IEnumerable<string> messages) where T : Result
{
result.Messages.AddRange(messages);
return result;
}
public static T Notice<T>(this T result, Notice notice) where T : Result public static T Notice<T>(this T result, Notice notice) where T : Result
{ {
result.Notices.Add(notice); result.Notices.Add(notice);
return result; return result;
} }
public static T Notice<T>(this T result, params Notice[] notices) where T : Result public static T Notice<T>(this T result, IEnumerable<Notice> notices) where T : Result
{ {
result.Notices.AddRange(notices); result.Notices.AddRange(notices);
return result; return result;