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


C# Func.ThrowIfNull方法代码示例

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


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

示例1: CompositeContextProviderFactory

 /// <summary>
 /// Initializes a new instance of the <see cref="CompositeContextProviderFactory"/> class.
 /// </summary>
 /// <param name="selectionFunction">
 /// The selection function.
 /// </param>
 /// <param name="factories">
 /// The factories to combine.
 /// </param>
 public CompositeContextProviderFactory(Func<IEnumerable<IContextProvider>, Type, IContextProvider> selectionFunction, params IContextProviderFactory[] factories)
 {
     selectionFunction.ThrowIfNull("selectionFunction");
     factories.ThrowIfNull("factories");
     this.selectionFunction = selectionFunction;
     this.factories = factories;
 }
开发者ID:julienblin,项目名称:backstage,代码行数:16,代码来源:CompositeContextProviderFactory.cs

示例2: ExpressionInstanceFactory

        /// <summary>
        ///     Creates a new instance of the <see cref="ExpressionInstanceFactory" /> class.
        /// </summary>
        /// <exception cref="ArgumentNullException">factory can not be null.</exception>
        /// <param name="factory">The factory.</param>
        /// <param name="name">The name of the factory.</param>
        /// <param name="description">The description of the factory.</param>
        public ExpressionInstanceFactory( Func<IMemberInformation, Object> factory, String name = null, String description = null )
            : base(name, description)
        {
            factory.ThrowIfNull( nameof( factory ) );

            _factory = factory;
        }
开发者ID:MannusEtten,项目名称:Extend,代码行数:14,代码来源:ExpressionInstanceFactory.cs

示例3: CreateIndex

 /// <summary>
 /// Create an index with the specified index settings
 /// </summary>
 public IIndicesResponse CreateIndex(string index, Func<CreateIndexDescriptor, CreateIndexDescriptor> createIndexSelector)
 {
     index.ThrowIfEmpty("index");
     createIndexSelector.ThrowIfNull("createIndexSelector");
     var d = createIndexSelector(new CreateIndexDescriptor());
     var settings = d._IndexSettings;
     return this.CreateIndex(index, settings);
 }
开发者ID:romankor,项目名称:NEST,代码行数:11,代码来源:ElasticClient-CreateIndex.cs

示例4: UrlResolver

		public UrlResolver(Func<IRouteCollection> routes, IHttpRuntime httpRuntime)
		{
			routes.ThrowIfNull("routes");
			httpRuntime.ThrowIfNull("httpRuntime");

			_routes = new Lazy<IRouteCollection>(routes);
			_httpRuntime = httpRuntime;
		}
开发者ID:kelong,项目名称:JuniorRoute,代码行数:8,代码来源:UrlResolver.cs

示例5: ModelMapper

		public ModelMapper(Func<Type, bool> parameterTypeMatchDelegate, IEnumerable<IModelPropertyMapper> propertyMappers)
		{
			parameterTypeMatchDelegate.ThrowIfNull("parameterTypeMatchDelegate");
			propertyMappers.ThrowIfNull("propertyMappers");

			_parameterTypeMatchDelegate = parameterTypeMatchDelegate;
			_modelPropertyMappers = propertyMappers.ToArray();
		}
开发者ID:nathan-alden,项目名称:junior-route,代码行数:8,代码来源:ModelMapper.cs

示例6: TexturedWindowRenderer

        protected TexturedWindowRenderer(Func<TextureContent, WindowTexture> getWindowTextureDelegate)
        {
            getWindowTextureDelegate.ThrowIfNull("getWindowTextureDelegate");

            _getWindowTextureDelegate = getWindowTextureDelegate;
            BackgroundColor = Color.White;
            BorderColor = Color.White;
        }
开发者ID:tj-miller,项目名称:TextAdventure,代码行数:8,代码来源:TexturedWindowRenderer.cs

示例7: PutWarmer

 /// <inheritdoc />
 public IIndicesOperationResponse PutWarmer(string name, Func<PutWarmerDescriptor, PutWarmerDescriptor> selector)
 {
     selector.ThrowIfNull("selector");
     return this.Dispatch<PutWarmerDescriptor, PutWarmerRequestParameters, IndicesOperationResponse>(
         d => selector(d.Name(name).AllIndices()),
         (p, d) => this.RawDispatch.IndicesPutWarmerDispatch<IndicesOperationResponse>(p, d)
     );
 }
开发者ID:NickCraver,项目名称:NEST,代码行数:9,代码来源:ElasticClient-Warmers.cs

示例8: ExpressionMemberSelectionRule

        /// <summary>
        ///     Initializes a new instance of the <see cref="ExpressionMemberSelectionRule" /> class.
        /// </summary>
        /// <exception cref="ArgumentNullException">predicate can not be null.</exception>
        /// <param name="predicate">The predicate used to determine if a member matches the rule.</param>
        /// <param name="selectionMode">The selection mode to apply.</param>
        /// <param name="name">The name of the rule.</param>
        /// <param name="description">The description of the rule.</param>
        public ExpressionMemberSelectionRule( Func<IMemberInformation, Boolean> predicate, MemberSelectionMode selectionMode, String name = null, String description = null )
            : base(name, description)
        {
            predicate.ThrowIfNull( nameof( predicate ) );

            _predicate = predicate;
            _selectionMode = selectionMode;
        }
开发者ID:MannusEtten,项目名称:Extend,代码行数:16,代码来源:ExpressionMemberSelectionRule.cs

示例9: ConcreteTypeConverter

        public ConcreteTypeConverter(Type baseType, Func<dynamic, Hit<dynamic>, Type> concreteTypeSelector, IEnumerable<string> partialFields)
        {
            concreteTypeSelector.ThrowIfNull("concreteTypeSelector");

            this._baseType = baseType;
            this._concreteTypeSelector = concreteTypeSelector;
            this._partialFields = partialFields;
        }
开发者ID:harishjan,项目名称:NEST,代码行数:8,代码来源:ConcreteTypeConverter.cs

示例10: RestoreObservable

		/// <inheritdoc />
		public IObservable<IRecoveryStatusResponse> RestoreObservable(TimeSpan interval, Func<RestoreDescriptor, RestoreDescriptor> restoreSelector = null)
		{
			restoreSelector.ThrowIfNull("restoreSelector");

			var restoreDescriptor = restoreSelector(new RestoreDescriptor());
			var observable = new RestoreObservable(this, restoreDescriptor);
			return observable;
		}
开发者ID:strongant,项目名称:elasticsearch-net,代码行数:9,代码来源:ElasticClient-Restore.cs

示例11: PutWarmerAsync

 public Task<IIndicesOperationResponse> PutWarmerAsync(string name, Func<PutWarmerDescriptor, PutWarmerDescriptor> selector)
 {
     selector.ThrowIfNull("selector");
     return this.DispatchAsync<PutWarmerDescriptor, PutWarmerQueryString, IndicesOperationResponse, IIndicesOperationResponse>(
         d => selector(d.Name(name).AllIndices()),
         (p, d) => this.RawDispatch.IndicesPutWarmerDispatchAsync(p, d)
     );
 }
开发者ID:v-kovrigin,项目名称:NEST,代码行数:8,代码来源:ElasticClient-Warmers.cs

示例12: SnapshotObservable

		/// <inheritdoc />
		public IObservable<ISnapshotStatusResponse> SnapshotObservable(TimeSpan interval, Func<SnapshotDescriptor, SnapshotDescriptor> snapshotSelector = null)
		{
			snapshotSelector.ThrowIfNull("snapshotSelector");

			var snapshotDescriptor = snapshotSelector(new SnapshotDescriptor());
			var observable = new SnapshotObservable(this, snapshotDescriptor);
			return observable;
		}
开发者ID:strongant,项目名称:elasticsearch-net,代码行数:9,代码来源:ElasticClient-Snapshot.cs

示例13: Map

        public void Map(Func<IContainer> container, Type type, MethodInfo method, Routing.Route route)
        {
            container.ThrowIfNull("container");
            type.ThrowIfNull("type");
            method.ThrowIfNull("method");
            route.ThrowIfNull("route");

            route.RespondWithNoContent();
        }
开发者ID:dblchu,项目名称:JuniorRoute,代码行数:9,代码来源:NoContentMapper.cs

示例14: JsonModelMapper

		public JsonModelMapper(Func<Type, bool> parameterTypeMatchDelegate, JsonSerializerSettings serializerSettings, DataConversionErrorHandling errorHandling = DataConversionErrorHandling.UseDefaultValue)
		{
			parameterTypeMatchDelegate.ThrowIfNull("parameterTypeMatchDelegate");
			serializerSettings.ThrowIfNull("serializerSettings");

			_parameterTypeMatchDelegate = parameterTypeMatchDelegate;
			_serializerSettings = serializerSettings;
			_errorHandling = errorHandling;
		}
开发者ID:nathan-alden,项目名称:junior-route,代码行数:9,代码来源:JsonModelMapper.cs

示例15: PutTemplateAsync

 public Task<IIndicesOperationResponse> PutTemplateAsync(string name, Func<PutTemplateDescriptor, PutTemplateDescriptor> putTemplateSelector)
 {
     putTemplateSelector.ThrowIfNull("putTemplateSelector");
     var descriptor = putTemplateSelector(new PutTemplateDescriptor(this._connectionSettings).Name(name));
     return this.DispatchAsync<PutTemplateDescriptor, PutTemplateQueryString, IndicesOperationResponse, IIndicesOperationResponse>(
         descriptor,
         (p, d) => this.RawDispatch.IndicesPutTemplateDispatchAsync(p, d._TemplateMapping)
     );
 }
开发者ID:v-kovrigin,项目名称:NEST,代码行数:9,代码来源:ElasticClient-Template.cs


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