Skip to content

Commit 9c1f606

Browse files
committed
Removed person repository.
1 parent 16dc374 commit 9c1f606

File tree

8 files changed

+7
-40
lines changed

8 files changed

+7
-40
lines changed

SimpleTaskSystem/SimpleTaskSystem.Application/People/PersonAppService.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
using System.Collections.Generic;
2+
using Abp.Domain.Repositories;
23
using AutoMapper;
34
using SimpleTaskSystem.People.Dtos;
45

56
namespace SimpleTaskSystem.People
67
{
78
public class PersonAppService : IPersonAppService //Optionally, you can derive from ApplicationService as we did for TaskAppService class.
89
{
9-
private readonly IPersonRepository _personRepository;
10+
private readonly IRepository<Person> _personRepository;
1011

11-
public PersonAppService(IPersonRepository personRepository)
12+
//ABP provides that we can directly inject IRepository<Person> (without creating any repository class)
13+
public PersonAppService(IRepository<Person> personRepository)
1214
{
1315
_personRepository = personRepository;
1416
}

SimpleTaskSystem/SimpleTaskSystem.Application/Tasks/TaskAppService.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections.Generic;
22
using Abp.Application.Services;
3+
using Abp.Domain.Repositories;
34
using AutoMapper;
45
using SimpleTaskSystem.People;
56
using SimpleTaskSystem.Tasks.Dtos;
@@ -17,13 +18,13 @@ public class TaskAppService : ApplicationService, ITaskAppService
1718
//These members set in constructor using constructor injection.
1819

1920
private readonly ITaskRepository _taskRepository;
20-
private readonly IPersonRepository _personRepository;
21+
private readonly IRepository<Person> _personRepository;
2122

2223
/// <summary>
2324
///In constructor, we can get needed classes/interfaces.
2425
///They are sent here by dependency injection system automatically.
2526
/// </summary>
26-
public TaskAppService(ITaskRepository taskRepository, IPersonRepository personRepository)
27+
public TaskAppService(ITaskRepository taskRepository, IRepository<Person> personRepository)
2728
{
2829
_taskRepository = taskRepository;
2930
_personRepository = personRepository;

SimpleTaskSystem/SimpleTaskSystem.Core/People/IPersonRepository.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

SimpleTaskSystem/SimpleTaskSystem.Core/SimpleTaskSystem.Core.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
</ItemGroup>
6969
<ItemGroup>
7070
<Compile Include="SimpleTaskSystemConsts.cs" />
71-
<Compile Include="People\IPersonRepository.cs" />
7271
<Compile Include="People\Person.cs" />
7372
<Compile Include="SimpleTaskSystemCoreModule.cs" />
7473
<Compile Include="Properties\AssemblyInfo.cs" />

SimpleTaskSystem/SimpleTaskSystem.Infrastructure.EntityFramework/EntityFramework/Repositories/PersonRepository.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

SimpleTaskSystem/SimpleTaskSystem.Infrastructure.EntityFramework/SimpleTaskSystem.Infrastructure.EntityFramework.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
<Reference Include="System.Xml" />
8181
</ItemGroup>
8282
<ItemGroup>
83-
<Compile Include="EntityFramework\Repositories\PersonRepository.cs" />
8483
<Compile Include="EntityFramework\Repositories\TaskRepository.cs" />
8584
<Compile Include="EntityFramework\SimpleTaskSystemDbContext.cs" />
8685
<Compile Include="EntityFramework\Repositories\SimpleTaskSystemRepositoryBase.cs" />

SimpleTaskSystem/SimpleTaskSystem.Infrastructure.NHibernate/NHibernate/Repositories/PersonRepository.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

SimpleTaskSystem/SimpleTaskSystem.Infrastructure.NHibernate/SimpleTaskSystem.Infrastructure.NHibernate.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
<Compile Include="DbMigrations\VersionTable.cs" />
8888
<Compile Include="NHibernate\EntityMappings\PersonMap.cs" />
8989
<Compile Include="NHibernate\EntityMappings\TaskMap.cs" />
90-
<Compile Include="NHibernate\Repositories\PersonRepository.cs" />
9190
<Compile Include="NHibernate\Repositories\TaskRepository.cs" />
9291
<Compile Include="SimpleTaskSystemDataModule.cs" />
9392
<Compile Include="Properties\AssemblyInfo.cs" />

0 commit comments

Comments
 (0)