Skip to content

Commit 3e5d266

Browse files
committed
Refactored and echanched Angular&Ef sample
1 parent 4b8ba0a commit 3e5d266

File tree

72 files changed

+3597
-681
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+3597
-681
lines changed

SimpleTaskSystemSPA_AngularJs_EntityFramework/README.md

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

SimpleTaskSystemSPA_AngularJs_EntityFramework/SimpleTaskSystem.Application/SimpleTaskSystem.Application.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
<WarningLevel>4</WarningLevel>
3131
</PropertyGroup>
3232
<ItemGroup>
33-
<Reference Include="Abp, Version=0.2.3.0, Culture=neutral, processorArchitecture=MSIL">
33+
<Reference Include="Abp, Version=0.2.3.1, Culture=neutral, processorArchitecture=MSIL">
3434
<SpecificVersion>False</SpecificVersion>
35-
<HintPath>..\packages\Abp.0.2.3.0\lib\net451\Abp.dll</HintPath>
35+
<HintPath>..\packages\Abp.0.2.3.1\lib\net451\Abp.dll</HintPath>
3636
</Reference>
37-
<Reference Include="Abp.Application, Version=0.2.3.0, Culture=neutral, processorArchitecture=MSIL">
37+
<Reference Include="Abp.Application, Version=0.2.3.1, Culture=neutral, processorArchitecture=MSIL">
3838
<SpecificVersion>False</SpecificVersion>
39-
<HintPath>..\packages\Abp.Application.0.2.3.0\lib\net451\Abp.Application.dll</HintPath>
39+
<HintPath>..\packages\Abp.Application.0.2.3.1\lib\net451\Abp.Application.dll</HintPath>
4040
</Reference>
4141
<Reference Include="AutoMapper, Version=3.2.1.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
4242
<SpecificVersion>False</SpecificVersion>

SimpleTaskSystemSPA_AngularJs_EntityFramework/SimpleTaskSystem.Application/Tasks/Dtos/UpdateTaskInput.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ public void AddValidationErrors(List<ValidationResult> results)
1818
{
1919
if (AssignedPersonId == null && State == null)
2020
{
21-
results.Add(new ValidationResult("Both of AssignedPersonId and State can not be null in order to update a Task!", new[] {"AssignedPersonId", "State"}));
21+
results.Add(new ValidationResult("Both of AssignedPersonId and State can not be null in order to update a Task!", new[] { "AssignedPersonId", "State" }));
2222
}
2323
}
24+
25+
public override string ToString()
26+
{
27+
return string.Format("[UpdateTask > TaskId = {0}, AssignedPersonId = {1}, State = {2}]", TaskId, AssignedPersonId, State);
28+
}
2429
}
2530
}

SimpleTaskSystemSPA_AngularJs_EntityFramework/SimpleTaskSystem.Application/Tasks/ITaskAppService.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ namespace SimpleTaskSystem.Tasks
66
public interface ITaskAppService : IApplicationService
77
{
88
GetTasksOutput GetTasks(GetTasksInput input);
9-
109
void UpdateTask(UpdateTaskInput input);
11-
1210
void CreateTask(CreateTaskInput input);
1311
}
1412
}

SimpleTaskSystemSPA_AngularJs_EntityFramework/SimpleTaskSystem.Application/Tasks/TaskAppService.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,24 @@
22
using System.Threading;
33
using Abp.Domain.Uow;
44
using AutoMapper;
5+
using Castle.Core.Logging;
56
using SimpleTaskSystem.People;
67
using SimpleTaskSystem.Tasks.Dtos;
78

89
namespace SimpleTaskSystem.Tasks
910
{
1011
public class TaskAppService : ITaskAppService
1112
{
13+
public ILogger Logger { get; set; }
14+
1215
private readonly ITaskRepository _taskRepository;
1316
private readonly IPersonRepository _personRepository;
1417

1518
public TaskAppService(ITaskRepository taskRepository, IPersonRepository personRepository)
1619
{
1720
_taskRepository = taskRepository;
1821
_personRepository = personRepository;
22+
Logger = NullLogger.Instance;
1923
}
2024

2125
public GetTasksOutput GetTasks(GetTasksInput input)
@@ -29,6 +33,8 @@ public GetTasksOutput GetTasks(GetTasksInput input)
2933

3034
public void UpdateTask(UpdateTaskInput input)
3135
{
36+
Logger.Info("Updating a task for input: " + input);
37+
3238
var task = _taskRepository.Get(input.TaskId);
3339

3440
if (input.State.HasValue)

SimpleTaskSystemSPA_AngularJs_EntityFramework/SimpleTaskSystem.Application/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Abp" version="0.2.3.0" targetFramework="net451" />
4-
<package id="Abp.Application" version="0.2.3.0" targetFramework="net451" />
3+
<package id="Abp" version="0.2.3.1" targetFramework="net451" />
4+
<package id="Abp.Application" version="0.2.3.1" targetFramework="net451" />
55
<package id="AutoMapper" version="3.2.1" targetFramework="net451" />
66
<package id="Castle.Core" version="3.3.0" targetFramework="net451" />
77
<package id="Castle.LoggingFacility" version="3.3.0" targetFramework="net451" />

SimpleTaskSystemSPA_AngularJs_EntityFramework/SimpleTaskSystem.Core/SimpleTaskSystem.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
<WarningLevel>4</WarningLevel>
3131
</PropertyGroup>
3232
<ItemGroup>
33-
<Reference Include="Abp, Version=0.2.3.0, Culture=neutral, processorArchitecture=MSIL">
33+
<Reference Include="Abp, Version=0.2.3.1, Culture=neutral, processorArchitecture=MSIL">
3434
<SpecificVersion>False</SpecificVersion>
35-
<HintPath>..\packages\Abp.0.2.3.0\lib\net451\Abp.dll</HintPath>
35+
<HintPath>..\packages\Abp.0.2.3.1\lib\net451\Abp.dll</HintPath>
3636
</Reference>
3737
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
3838
<SpecificVersion>False</SpecificVersion>

SimpleTaskSystemSPA_AngularJs_EntityFramework/SimpleTaskSystem.Core/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Abp" version="0.2.3.0" targetFramework="net451" />
3+
<package id="Abp" version="0.2.3.1" targetFramework="net451" />
44
<package id="Castle.Core" version="3.3.0" targetFramework="net451" />
55
<package id="Castle.LoggingFacility" version="3.3.0" targetFramework="net451" />
66
<package id="Castle.Windsor" version="3.3.0" targetFramework="net451" />

SimpleTaskSystemSPA_AngularJs_EntityFramework/SimpleTaskSystem.Infrastructure.EntityFramework/App.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<configSections>
4-
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
54
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
65
</configSections>
76
<entityFramework>

SimpleTaskSystemSPA_AngularJs_EntityFramework/SimpleTaskSystem.Infrastructure.EntityFramework/EntityFramework/Repositories/SimpleTaskSystemRepositoryBase.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
using Abp.Domain.Entities;
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using Abp.Domain.Entities;
26
using Abp.Domain.Repositories.EntityFramework;
37

48
namespace SimpleTaskSystem.EntityFramework.Repositories
@@ -11,6 +15,6 @@ public abstract class SimpleTaskSystemRepositoryBase<TEntity, TPrimaryKey> : EfR
1115
public abstract class SimpleTaskSystemRepositoryBase<TEntity> : SimpleTaskSystemRepositoryBase<TEntity, int>
1216
where TEntity : class, IEntity<int>
1317
{
14-
18+
1519
}
16-
}
20+
}

0 commit comments

Comments
 (0)