本文整理汇总了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;
}
示例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));
}
示例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));
}
示例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);
}
示例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;
}
示例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;
}