本文整理汇总了C#中ILog.NotNull方法的典型用法代码示例。如果您正苦于以下问题:C# ILog.NotNull方法的具体用法?C# ILog.NotNull怎么用?C# ILog.NotNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILog
的用法示例。
在下文中一共展示了ILog.NotNull方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Using
/// <summary>
/// Sets the logger to be used to log the exception
/// </summary>
/// <param name="logger">The logger to be used</param>
/// <returns>This log</returns>
public Log Using(ILog logger)
{
logger.NotNull(nameof(logger));
Logger = logger;
return this;
}
示例2: LogHandler
/// <summary>
/// Constructor
/// </summary>
/// <param name="severity">Severity used to log the error messages</param>
/// <param name="errorMessageFormat">The message format used to log the exceptions</param>
/// <param name="logger">The logger</param>
public LogHandler(
Severity severity,
string errorMessageFormat,
ILog logger)
{
logger.NotNull(nameof(logger));
errorMessageFormat.NotNullOrEmpty(nameof(errorMessageFormat));
Severity = severity;
ErrorMessageFormat = errorMessageFormat;
_logger = logger;
}
示例3: TokenController
/// <summary>
/// Constructor
/// </summary>
/// <param name="logger">The logger</param>
/// <param name="claimsIdentityRetriever">The implementation to retrieve ClaimsIdentity</param>
/// <param name="jwtSecurityTokenGenerator">The JWT token generator</param>
/// <param name="jwtGenerationOptionsFactory">The Jwt generation options factory</param>
public TokenController(
ILog logger,
IClaimsIdentityRetriever claimsIdentityRetriever,
IJwtSecurityTokenGenerator jwtSecurityTokenGenerator,
IJwtGenerationOptionsFactory jwtGenerationOptionsFactory)
{
logger.NotNull(nameof(logger));
claimsIdentityRetriever.NotNull(nameof(claimsIdentityRetriever));
jwtSecurityTokenGenerator.NotNull(nameof(jwtSecurityTokenGenerator));
jwtGenerationOptionsFactory.NotNull(nameof(jwtGenerationOptionsFactory));
_logger = logger;
_claimsIdentityRetriever = claimsIdentityRetriever;
_jwtSecurityTokenGenerator = jwtSecurityTokenGenerator;
_jwtGenerationOptionsFactory = jwtGenerationOptionsFactory;
}