2
using System.Collections.Generic;
4
namespace ServiceStack.Common.Utils
6
public static class AssertUtils
8
public static void AreNotNull<T>(params T[] fields) where T : class
10
foreach (var field in fields)
14
throw new ArgumentNullException(typeof(T).Name);
20
/// Asserts that the supplied arguments are not null.
22
/// AssertUtils.AreNotNull(new Dictionary<string,object>{ {"name",null} });
23
/// will throw new ArgumentNullException("name");
25
/// <param name="fieldMap">The field map.</param>
26
public static void AreNotNull(IDictionary<string,object> fieldMap)
28
foreach (var pair in fieldMap)
30
if (pair.Value == null)
32
throw new ArgumentNullException(pair.Key);
b'\\ No newline at end of file'