Skip to content

Commit ecd3d65

Browse files
committed
feat: 增加 IRegionSerivce 服务
1 parent 45057f8 commit ecd3d65

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
// Website: https://www.blazor.zone or https://argozhang.github.io/
4+
5+
using Microsoft.Extensions.DependencyInjection;
6+
7+
namespace BootstrapBlazor.Components;
8+
9+
/// <summary>
10+
/// BootstrapBlazor service extensions
11+
/// </summary>
12+
public static class ServiceCollectionExtension
13+
{
14+
/// <summary>
15+
/// Inject <see cref="IRegionService"/> service extension method.
16+
/// </summary>
17+
/// <param name="services"></param>
18+
/// <returns></returns>
19+
public static IServiceCollection AddBootstrapBlazorRegionService(this IServiceCollection services)
20+
{
21+
services.AddSingleton<IRegionService, DefaultRegionService>();
22+
23+
return services;
24+
}
25+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
// Website: https://www.blazor.zone or https://argozhang.github.io/
4+
5+
namespace BootstrapBlazor.Components;
6+
7+
class DefaultRegionService : IRegionService
8+
{
9+
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
// Website: https://www.blazor.zone or https://argozhang.github.io/
4+
5+
namespace BootstrapBlazor.Components;
6+
7+
/// <summary>
8+
/// IRegion 获得行政区域数据接口
9+
/// </summary>
10+
public interface IRegionService
11+
{
12+
}

0 commit comments

Comments
 (0)