public static DomainDataRuleException Required <T>(params string[] fieldNames) { var exception = new DomainDataRuleException(); exception.WithEntity <T>(); if (fieldNames != null) { exception.WithData($"{typeof(T).Name}.{string.Join(".", fieldNames)}", nameof(Required)); } return(exception); }
public static DomainDataRuleException Of <T>(string message, params string[] fieldNames) { var exception = new DomainDataRuleException(message); exception.WithEntity <T>(); if (fieldNames != null) { exception.WithData($"{typeof(T).Name}.{string.Join(".", fieldNames)}", message); } return(exception); }