Commit 86e5a301 authored by yangxiaodong's avatar yangxiaodong

Refactor.

parent 3fd2b4a5
......@@ -17,13 +17,13 @@ namespace Microsoft.Extensions.DependencyInjection
public static class ServiceCollectionExtensions
{
/// <summary>
/// Adds and configures the consistence services for the consitence.
/// Adds and configures the CAP services for the consitence.
/// </summary>
/// <param name="services">The services available in the application.</param>
/// <returns>An <see cref="CapBuilder"/> for application services.</returns>
public static CapBuilder AddConsistency(this IServiceCollection services)
public static CapBuilder AddCap(this IServiceCollection services)
{
services.AddConsistency(x => new CapOptions());
services.AddCap(x => new CapOptions());
return new CapBuilder(services);
}
......@@ -34,7 +34,7 @@ namespace Microsoft.Extensions.DependencyInjection
/// <param name="services">The services available in the application.</param>
/// <param name="setupAction">An action to configure the <see cref="CapOptions"/>.</param>
/// <returns>An <see cref="CapBuilder"/> for application services.</returns>
public static CapBuilder AddConsistency(
public static CapBuilder AddCap(
this IServiceCollection services,
Action<CapOptions> setupAction)
{
......
......@@ -14,7 +14,7 @@ namespace DotNetCore.CAP.Test
public void CanOverrideMessageStore()
{
var services = new ServiceCollection();
services.AddConsistency().AddMessageStore<MyMessageStore>();
services.AddCap().AddMessageStore<MyMessageStore>();
var thingy = services.BuildServiceProvider()
......@@ -27,7 +27,7 @@ namespace DotNetCore.CAP.Test
public void CanOverrideJobs()
{
var services = new ServiceCollection();
services.AddConsistency().AddJobs<MyJobTest>();
services.AddCap().AddJobs<MyJobTest>();
var thingy = services.BuildServiceProvider()
.GetRequiredService<IJob>() as MyJobTest;
......@@ -39,7 +39,7 @@ namespace DotNetCore.CAP.Test
public void CanOverrideProducerService()
{
var services = new ServiceCollection();
services.AddConsistency().AddProducerService<MyProducerService>();
services.AddCap().AddProducerService<MyProducerService>();
var thingy = services.BuildServiceProvider()
.GetRequiredService<ICapProducerService>() as MyProducerService;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment