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


C# IServiceCollection.CutoffPrevious方法代码示例

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


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

示例1: ConfigureApi

 protected override IServiceCollection ConfigureApi(IServiceCollection services)
 {
     services = base.ConfigureApi(services);
     services.CutoffPrevious<IModelBuilder>(new TestModelProducer(StoreModel.Model));
     services.CutoffPrevious<IModelMapper>(new TestModelMapper());
     services.CutoffPrevious<IQueryExpressionSourcer>(new TestQueryExpressionSourcer());
     services.CutoffPrevious<IChangeSetPreparer>(new TestChangeSetPreparer());
     services.CutoffPrevious<ISubmitExecutor>(new TestSubmitExecutor());
     return services;
 }
开发者ID:kosinsky,项目名称:RESTier,代码行数:10,代码来源:StoreApi.cs

示例2: ApplyTo

 /// <inheritdoc/>
 public static void ApplyTo(
     IServiceCollection services,
     Type targetType)
 {
     Ensure.NotNull(services, "services");
     Ensure.NotNull(targetType, "targetType");
     services.CutoffPrevious<IChangeSetEntryAuthorizer>(new ConventionBasedChangeSetAuthorizer(targetType));
 }
开发者ID:kosinsky,项目名称:RESTier,代码行数:9,代码来源:ConventionBasedChangeSetAuthorizer.cs

示例3: ApplyTo

 /// <inheritdoc/>
 public static void ApplyTo(
     IServiceCollection services,
     Type targetType)
 {
     Ensure.NotNull(services, "services");
     Ensure.NotNull(targetType, "targetType");
     services.CutoffPrevious<IQueryExpressionFilter>(new ConventionBasedEntitySetFilter(targetType));
 }
开发者ID:kosinsky,项目名称:RESTier,代码行数:9,代码来源:ConventionBasedEntitySetFilter.cs

示例4: EnableConventions

        /// <summary>
        /// Enables code-based conventions for an API.
        /// </summary>
        /// <param name="services">
        /// The <see cref="IServiceCollection"/> containing API service registrations.
        /// </param>
        /// <param name="targetType">
        /// The type of a class on which code-based conventions are used.
        /// </param>
        /// <remarks>
        /// This method adds hook points to the API configuration that
        /// inspect a target type for a variety of code-based conventions
        /// such as usage of specific attributes or members that follow
        /// certain naming conventions.
        /// </remarks>
        private static void EnableConventions(
            IServiceCollection services,
            Type targetType)
        {
            Ensure.NotNull(services, "services");
            Ensure.NotNull(targetType, "targetType");

            ConventionBasedChangeSetAuthorizer.ApplyTo(services, targetType);
            ConventionBasedChangeSetEntryFilter.ApplyTo(services, targetType);
            services.CutoffPrevious<IChangeSetEntryValidator, ConventionBasedChangeSetEntryValidator>();
            ConventionBasedApiModelBuilder.ApplyTo(services, targetType);
            ConventionBasedOperationProvider.ApplyTo(services, targetType);
            ConventionBasedEntitySetFilter.ApplyTo(services, targetType);
        }
开发者ID:kosinsky,项目名称:RESTier,代码行数:29,代码来源:ApiBase.cs

示例5: ConfigureApi

            protected override IServiceCollection ConfigureApi(IServiceCollection services)
            {
                var modelBuilder = new TestModelBuilder();
                var modelMapper = new TestModelMapper();
                var querySourcer = new TestQuerySourcer();
                var changeSetPreparer = new TestChangeSetPreparer();
                var submitExecutor = new TestSubmitExecutor();

                services.CutoffPrevious<IQueryExecutor>(DefaultQueryExecutor.Instance);
                services.CutoffPrevious<IModelBuilder>(modelBuilder);
                services.CutoffPrevious<IModelMapper>(modelMapper);
                services.CutoffPrevious<IQueryExpressionSourcer>(querySourcer);
                services.CutoffPrevious<IChangeSetPreparer>(changeSetPreparer);
                services.CutoffPrevious<ISubmitExecutor>(submitExecutor);

                return services;
            }
开发者ID:kosinsky,项目名称:RESTier,代码行数:17,代码来源:Api.Tests.cs

示例6: ConfigureApi

 protected override IServiceCollection ConfigureApi(IServiceCollection services)
 {
     services = base.ConfigureApi(services);
     services.CutoffPrevious<IModelBuilder>(new TestModelProducer(FallbackModel.Model));
     services.CutoffPrevious<IModelMapper>(new FallbackModelMapper());
     services.CutoffPrevious<IQueryExpressionSourcer>(new FallbackQueryExpressionSourcer());
     return services;
 }
开发者ID:kosinsky,项目名称:RESTier,代码行数:8,代码来源:FallbackTests.cs


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