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


C# Func.NotNull方法代码示例

本文整理汇总了C#中Func.NotNull方法的典型用法代码示例。如果您正苦于以下问题:C# Func.NotNull方法的具体用法?C# Func.NotNull怎么用?C# Func.NotNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Func的用法示例。


在下文中一共展示了Func.NotNull方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: JobConfiguration

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="jobType">The type of the class that implements the job</param>
        /// <param name="builder">The trigger builder</param>
        public JobConfiguration(
            Type jobType,
            Func<TriggerBuilder> builder)
        {
            jobType.Is<IJob>();
            builder.NotNull(nameof(builder));

            JobType = jobType;
            TriggerBuilder = builder;
        }
开发者ID:c4rm4x,项目名称:C4rm4x.WebApi,代码行数:15,代码来源:JobConfiguration.cs

示例2: GetAssemblies

        /// <summary>
        /// Returns the list of all the assemblies that have been loaded
        /// into the execution context of appDomain that fulfill the predicate
        /// </summary>
        /// <param name="appDomain">The app domain</param>
        /// <param name="predicate">Predicate</param>
        /// <returns>The list of all assemblyes already loaded into the execution context of app domain that fulfill the predicate</returns>
        public static IEnumerable<Assembly> GetAssemblies(
            this AppDomain appDomain,
            Func<Assembly, bool> predicate)
        {
            appDomain.NotNull(nameof(appDomain));
            predicate.NotNull(nameof(predicate));

            return appDomain
                .GetAssemblies()
                .Where(predicate)
                .ToList();
        }
开发者ID:c4rm4x,项目名称:C4rm4x.Tools,代码行数:19,代码来源:AssemblyExtensions.cs

示例3: SetDateTimeNowFactory

        /// <summary>
        /// Sets the DateTime Now factory
        /// </summary>
        /// <param name="dateTimeNowFactory">The factory</param>
        /// <remarks>USE THIS ONLY FOR UNIT TESTING</remarks>
        internal void SetDateTimeNowFactory(Func<DateTime> dateTimeNowFactory)
        {
            dateTimeNowFactory.NotNull(nameof(dateTimeNowFactory));

            _dateTimeNowFactory = dateTimeNowFactory;
        }
开发者ID:c4rm4x,项目名称:C4rm4x.Tools,代码行数:11,代码来源:JwtSecurityTokenGenerator.cs

示例4: SetSecurityTokenHandlerFactory

        /// <summary>
        /// Sets the security token handler factory
        /// </summary>
        /// <param name="securityTokenHandlerFactory">The factory</param>
        /// <remarks>USE THIS ONLY FOR UNIT TESTING</remarks>
        internal void SetSecurityTokenHandlerFactory(Func<JwtSecurityTokenHandler> securityTokenHandlerFactory)
        {
            securityTokenHandlerFactory.NotNull(nameof(securityTokenHandlerFactory));

            _securityTokenHandlerFactory = securityTokenHandlerFactory;
        }
开发者ID:c4rm4x,项目名称:C4rm4x.Tools,代码行数:11,代码来源:JwtSecurityTokenGenerator.cs

示例5: SetCorsEngineFactory

        /// <summary>
        /// Sets the CORS engine factory
        /// </summary>
        /// <param name="corsEngineFactory">The factory</param>
        /// <remarks>USE THIS ONLY FOR UNIT TESTING</remarks>
        internal void SetCorsEngineFactory(Func<CorsEngine> corsEngineFactory)
        {
            corsEngineFactory.NotNull(nameof(corsEngineFactory));

            _corsEngineFactory = corsEngineFactory;
        }
开发者ID:c4rm4x,项目名称:C4rm4x.WebApi,代码行数:11,代码来源:CorsBasedSecurityMessageHandler.cs

示例6: SetSubscriberRepositoryFactory

        /// <summary>
        /// Sets the subscriber repository factory
        /// </summary>
        /// <remarks>USE THIS ONLY UNIT TESTING</remarks>
        /// <param name="subscriberRepositoryFactory">The factory</param>
        internal void SetSubscriberRepositoryFactory(
            Func<AclConfiguration, HttpRequestMessage, ISubscriberRepository> subscriberRepositoryFactory)
        {
            subscriberRepositoryFactory.NotNull(nameof(subscriberRepositoryFactory));

            _subscriberRepositoryFactory = subscriberRepositoryFactory;
        }
开发者ID:c4rm4x,项目名称:C4rm4x.WebApi,代码行数:12,代码来源:AclBasedSecurityMessageHandler.cs

示例7: SetResolverFactory

        /// <summary>
        /// Sets the resolver factory
        /// </summary>
        /// <remarks>USE THIS ONLY FOR UNIT TESTING</remarks>
        /// <param name="resolverFactory">The factory</param>
        internal void SetResolverFactory(Func<HttpRequestMessage, Type, object> resolverFactory)
        {
            resolverFactory.NotNull(nameof(resolverFactory));

            _resolverFactory = resolverFactory;
        }
开发者ID:c4rm4x,项目名称:C4rm4x.WebApi,代码行数:11,代码来源:AclConfiguration.cs

示例8: RegisterAclCacheProvider

        /// <summary>
        /// Register the ACL cache provider 
        /// (in case it differs from the cache for the rest of the application)
        /// </summary>
        /// <param name="provider"></param>
        public void RegisterAclCacheProvider(Func<ICache> provider)
        {
            provider.NotNull(nameof(provider));

            _config.Properties.GetOrAdd(typeof(ICache), obj => provider);
        }
开发者ID:c4rm4x,项目名称:C4rm4x.WebApi,代码行数:11,代码来源:AclConfiguration.cs

示例9: SetNowFactory

        /// <summary>
        /// Sets the now factory
        /// </summary>
        /// <param name="nowFactory">The factory</param>
        /// <remarks>USE THIS ONLY FOR UNIT TESTING</remarks>
        internal void SetNowFactory(Func<DateTime> nowFactory)
        {
            nowFactory.NotNull(nameof(nowFactory));

            _nowFactory = nowFactory;
        }
开发者ID:c4rm4x,项目名称:C4rm4x.WebApi,代码行数:11,代码来源:OutputCacheAttribute.cs


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