public static void IfNotCastable <T>([CanBeNull][NoEnumeration] object value, Violation message) { Fail.IfNotCastable(value, typeof(T), message); }
public static void IfNullOrNotCastable <T>([CanBeNull][NoEnumeration] object value) { Fail.IfNull(value, Violation.WhenCannotCast <T>("object", value)); Fail.IfNotCastable <T>(value, Violation.WhenCannotCast <T>("object", value)); }
public static void IfNotCastable <T>([CanBeNull][NoEnumeration] object value, [NotNull] string message, [NotNull] params object[] args) { Fail.IfNotCastable(value, typeof(T), message, args); }
public static T AsOrFail <T>([CanBeNull][NoEnumeration] this object value, [CanBeNull] string name = null) { Fail.IfNotCastable <T>(value, Violation.WhenCannotCast <T>(name ?? "object", value)); return((T)value); }
public static void IfNullOrNotCastable <T>([CanBeNull][NoEnumeration] object value) { Fail.IfNull(value, Fail.notCastableMessage, typeof(T), "<null>"); Fail.IfNotCastable <T>(value, Fail.notCastableMessage, typeof(T), value); }
public static T AsOrFail <T>([CanBeNull][NoEnumeration] this object value, [CanBeNull] string name = null) { Fail.IfNotCastable <T>(value, Fail.notCastableMessageWithName, name ?? "object", typeof(T), value); return((T)value); }
public static void IfArgumentEmpty(Guid value, [NotNull] string argumentName) { Fail.RequiresArgumentName(argumentName); Fail.IfEmpty(value, Violation.WhenGuidArgumentIsEmpty(argumentName)); }
// ReSharper disable once InconsistentNaming public static void fian([CanBeNull][NoEnumeration] this object argumentValue) { Fail.IfArgumentNull(argumentValue, nameof(argumentValue)); }
public static void IfArgumentEmpty(Guid value, [NotNull][InvokerParameterName] string argumentName) { Fail.RequiresArgumentName(argumentName); Fail.IfEqual(Guid.Empty, value, "Argument '{0}' is an empty Guid.", argumentName); }
public static void IfEmpty(Guid value, Violation message) { Fail.IfEqual(Guid.Empty, value, message); }
public static void IfEmpty(Guid value, [NotNull] string message, [NotNull] params object[] args) { Fail.RequiresMessage(message, args); Fail.IfEqual(Guid.Empty, value, message, args); }
public static DesignByContractViolationException Because <T1>([NotNull][System.Diagnostics.CodeAnalysis.NotNull] string message, T1 arg1) { return(Fail.Because(message.Formatted(arg1))); }
public static DesignByContractViolationException Because([NotNull][System.Diagnostics.CodeAnalysis.NotNull] string message) { Fail.RequiresMessage(message); return(new DesignByContractViolationException(message)); }
// ReSharper disable once InconsistentNaming public static void fiaw([CanBeNull] this string argumentValue) { Fail.IfArgumentWhiteSpace(argumentValue, nameof(argumentValue)); }
// ReSharper disable once InconsistentNaming public static void fiae([CanBeNull] this string argumentValue) { Fail.IfArgumentEmpty(argumentValue, nameof(argumentValue)); }