1. SdkGuard

Class SdkGuard

Version:
日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

Inheritance
System.Object
SdkGuard
Namespace: Stylelabs.M.Sdk.Utilities
Assembly: Stylelabs.M.Sdk.dll
Syntax
public static class SdkGuard : object

Methods

GreaterThan(String, Int64, Int64)

Checks if the specified long is greater than a given minimum. Otherwise if the specified long is lower or equal to given minimum, fail.

Declaration
public static void GreaterThan(string argument, long value, long minimum)
Parameters
TypeNameDescription
System.Stringargument

The name of the argument.

System.Int64value

The value of the argument.

System.Int64minimum

The minimum.

NotNegative(String, Int64)

Checks if the specified long is negative.

Declaration
public static void NotNegative(string argument, long value)
Parameters
TypeNameDescription
System.Stringargument

The name of the argument.

System.Int64value

The value of the argument.

NotNull(String, Object)

Checks if the specified value is null.

Declaration
public static void NotNull(string argument, object value)
Parameters
TypeNameDescription
System.Stringargument

The name of the argument.

System.Objectvalue

The value of the argument.

NotNullEach<T>(String, T)

Checks if the specified collection is null or contains null values.

Declaration
public static void NotNullEach<T>(string argument, T value)
    where T : IEnumerable
Parameters
TypeNameDescription
System.Stringargument

The name of the argument.

Tvalue

The value of the argument.

Type Parameters
NameDescription
T

Type of the collection.

NotNullMaxOneId(String, IEnumerable<Int64>)

The ids cannot be null. It can be empty, but it cannot contain more than 1 value. The value must be a strictly positive id, if it exists.

Declaration
public static void NotNullMaxOneId(string parameterName, IEnumerable<long> ids)
Parameters
TypeNameDescription
System.StringparameterName

Name of the parameter.

IEnumerable<System.Int64>ids

Collection to check.

NotNullOrEmptyCollection<T>(String, T)

Checks if the specified collection is null or empty.

Declaration
public static void NotNullOrEmptyCollection<T>(string argument, T value)
    where T : IEnumerable
Parameters
TypeNameDescription
System.Stringargument

The name of the argument.

Tvalue

The value of the argument.

Type Parameters
NameDescription
T

Type of the collection.

NotNullOrInvariantCulture(String, CultureInfo)

Checks if the specified culture is null or invariant culture.

Declaration
public static void NotNullOrInvariantCulture(string argument, CultureInfo culture)
Parameters
TypeNameDescription
System.Stringargument

The name of the argument.

CultureInfoculture

The culture.

NotNullOrInvariantCultureEach(String, IEnumerable<CultureInfo>)

Checks if the specified culture is null or invariant culture.

Declaration
public static void NotNullOrInvariantCultureEach(string argument, IEnumerable<CultureInfo> cultures)
Parameters
TypeNameDescription
System.Stringargument

The name of the argument.

IEnumerable<CultureInfo>cultures

The cultures.

NotNullOrWhiteSpace(String, String)

Checks if the specified value is null, an empty string or white space string.

Declaration
public static void NotNullOrWhiteSpace(string argument, string value)
Parameters
TypeNameDescription
System.Stringargument

The name of the argument.

System.Stringvalue

The value of the argument.

NotNullOrWhiteSpaceEach(String, IEnumerable<String>)

Checks if the specified collection is null or contains null or white space strings.

Declaration
public static void NotNullOrWhiteSpaceEach(string argument, IEnumerable<string> value)
Parameters
TypeNameDescription
System.Stringargument

The name of the argument.

IEnumerable<System.String>value

The value of the argument.

StrictlyPositive(String, Int32)

Checks if the specified number is strictly positive, i.e. greater than zero.

Declaration
public static void StrictlyPositive(string argument, int value)
Parameters
TypeNameDescription
System.Stringargument

The name of the argument.

System.Int32value

The value of the argument.

StrictlyPositive(String, TimeSpan)

Checks if the specified time span is strictly positive, i.e. greater than zero.

Declaration
public static void StrictlyPositive(string argument, TimeSpan value)
Parameters
TypeNameDescription
System.Stringargument

The name of the argument.

TimeSpanvalue

The value of the argument.

ValidId(String, Nullable<Int64>)

If the id is not null, it must be strictly positive.

Declaration
public static void ValidId(string parameterName, long? id)
Parameters
TypeNameDescription
System.StringparameterName

Name of the parameter.

System.Nullable<System.Int64>id

Id to check

ValidIds(String, IEnumerable<Int64>)

The ids cannot be null, and every id must be strictly positive.

Declaration
public static void ValidIds(string parameterName, IEnumerable<long> ids)
Parameters
TypeNameDescription
System.StringparameterName

Name of the parameter.

IEnumerable<System.Int64>ids

Ids to check

この記事を改善するための提案がある場合は、 お知らせください!