当前位置: 首页>>代码示例>>C#>>正文


C# ILog.NotNull方法代码示例

本文整理汇总了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;
        }
开发者ID:c4rm4x,项目名称:C4rm4x.WebApi,代码行数:13,代码来源:Log.cs

示例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;
        }
开发者ID:c4rm4x,项目名称:C4rm4x.WebApi,代码行数:18,代码来源:LogHandler.cs

示例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;
        }
开发者ID:c4rm4x,项目名称:C4rm4x.WebApi,代码行数:23,代码来源:TokenController.cs


注:本文中的ILog.NotNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。