Skip to content

Commit 7cb5459

Browse files
committed
Registered all app services to dnamic api controller automatically.
1 parent 5c0b794 commit 7cb5459

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

Templates/All-In-One-Template/MySpaProject/MySpaProject.Application/MySpaProject.Application.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
</ItemGroup>
7070
<ItemGroup>
7171
<Compile Include="MySpaProjectApplicationModule.cs" />
72-
<Compile Include="MySpaProjectApplicationServiceBase.cs" />
72+
<Compile Include="MySpaProjectAppServiceBase.cs" />
7373
<Compile Include="Properties\AssemblyInfo.cs" />
7474
</ItemGroup>
7575
<ItemGroup>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ namespace MySpaProject
55
/// <summary>
66
/// Derive your application services from this class.
77
/// </summary>
8-
public abstract class MySpaProjectApplicationServiceBase : ApplicationService
8+
public abstract class MySpaProjectAppServiceBase : ApplicationService
99
{
10-
protected MySpaProjectApplicationServiceBase()
10+
protected MySpaProjectAppServiceBase()
1111
{
1212
LocalizationSourceName = MySpaProjectConsts.LocalizationSourceName;
1313
}

Templates/All-In-One-Template/MySpaProject/MySpaProject.WebApi/MySpaProjectWebApiModule.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System.Reflection;
2+
using Abp.Application.Services;
23
using Abp.Modules;
34
using Abp.WebApi;
5+
using Abp.WebApi.Controllers.Dynamic.Builders;
46

57
namespace MySpaProject
68
{
@@ -10,6 +12,10 @@ public class MySpaProjectWebApiModule : AbpModule
1012
public override void Initialize()
1113
{
1214
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
15+
16+
DynamicApiControllerBuilder
17+
.ForAll<IApplicationService>(typeof(MySpaProjectApplicationModule).Assembly, "app")
18+
.Build();
1319
}
1420
}
1521
}

0 commit comments

Comments
 (0)