Skip to content

Commit 20d4a60

Browse files
committed
Used DynamicApiControllerBuilder.ForAll.
1 parent 2512d66 commit 20d4a60

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

SimpleTaskSystem/SimpleTaskSystem.EntityFramework/SimpleTaskSystemDataModule.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using System.Reflection;
2+
using Abp.EntityFramework;
23
using Abp.Modules;
34

45
namespace SimpleTaskSystem
56
{
6-
[DependsOn(typeof(SimpleTaskSystemCoreModule))]
7+
[DependsOn(typeof(SimpleTaskSystemCoreModule), typeof(AbpEntityFrameworkModule))]
78
public class SimpleTaskSystemDataModule : AbpModule
89
{
910
public override void Initialize()

SimpleTaskSystem/SimpleTaskSystem.NHibernate/SimpleTaskSystemDataModule.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
using System.Configuration;
22
using System.Reflection;
33
using Abp.Modules;
4+
using Abp.NHibernate;
45
using Abp.NHibernate.Config;
56
using FluentNHibernate.Cfg.Db;
67

78
namespace SimpleTaskSystem
89
{
9-
[DependsOn(typeof(SimpleTaskSystemCoreModule))]
10+
[DependsOn(typeof(SimpleTaskSystemCoreModule), typeof(AbpNHibernateModule))]
1011
public class SimpleTaskSystemDataModule : AbpModule
1112
{
1213
public override void PreInitialize()
1314
{
1415
var connStr = ConfigurationManager.ConnectionStrings["Default"].ConnectionString;
16+
1517
Configuration.Modules.AbpNHibernate().FluentConfiguration
1618
.Database(MsSqlConfiguration.MsSql2008.ConnectionString(connStr))
1719
.Mappings(m => m.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly()));

SimpleTaskSystem/SimpleTaskSystem.WebApi/SimpleTaskSystemWebApiModule.cs

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

87
namespace SimpleTaskSystem
98
{
@@ -21,14 +20,8 @@ public override void Initialize()
2120
//Creating dynamic Web Api Controllers for application services.
2221
//Thus, 'web api layer' is created automatically by ABP.
2322

24-
//TODO: Use ForAll!!!
25-
26-
DynamicApiControllerBuilder
27-
.For<ITaskAppService>("tasksystem/task")
28-
.Build();
29-
3023
DynamicApiControllerBuilder
31-
.For<IPersonAppService>("tasksystem/person")
24+
.ForAll<IApplicationService>(Assembly.GetAssembly(typeof (SimpleTaskSystemApplicationModule)), "tasksystem")
3225
.Build();
3326
}
3427
}

0 commit comments

Comments
 (0)