Skip to content

Commit 4765d57

Browse files
committed
Fixed issue
1 parent 5af4b8f commit 4765d57

File tree

10 files changed

+40
-118
lines changed

10 files changed

+40
-118
lines changed

OnionArchitecture/OA.Infrastructure/Extension/ConfigureServiceContainer.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,11 @@ public static void AddController(this IServiceCollection serviceCollection)
9090
serviceCollection.AddControllers().AddNewtonsoftJson();
9191
}
9292

93-
public static void AddMediatorCQRS(this IServiceCollection services)
94-
{
95-
services.AddMediatR(Assembly.GetExecutingAssembly());
96-
}
93+
//public static void AddMediatorCQRS(this IServiceCollection services)
94+
//{
95+
// //var assembly = AppDomain.CurrentDomain.Load("OA.Service");
96+
// services.AddMediatR(Assembly.GetExecutingAssembly());
97+
//}
9798

9899
}
99100
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using MediatR;
2+
using Microsoft.Extensions.DependencyInjection;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Reflection;
7+
using System.Text;
8+
using System.Threading.Tasks;
9+
10+
namespace OA.Service
11+
{
12+
public static class DependencyInjection
13+
{
14+
public static void AddMediatorCQRS(this IServiceCollection services)
15+
{
16+
// or you can use assembly in Extension method in Infra layer with below command
17+
// var assembly = AppDomain.CurrentDomain.Load("OA.Service");
18+
services.AddMediatR(Assembly.GetExecutingAssembly());
19+
}
20+
}
21+
}
22+
23+

OnionArchitecture/OA.Test.Integration/ApiCustomerTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace OA.Test.Integration
88
public class ApiCustomerTest
99
{
1010
[TestCase("Get", "api/Customer")]
11-
[TestCase("Get", "api/Customer/Amazon")]
11+
[TestCase("Get", "api/Customer/1")]
1212
public async Task GetAllCustomerTestAsync(string method, string URL)
1313
{
1414
using var client = new TestClientProvider().Client;

OnionArchitecture/OA.Test.Unit/Controller/CustomerControllerTest.cs

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

OnionArchitecture/OA.Test.Unit/OA.Test.Unit.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@
1818
<ProjectReference Include="..\OA\OA.csproj" />
1919
</ItemGroup>
2020

21+
<ItemGroup>
22+
<Folder Include="Controller\" />
23+
<Folder Include="Service\" />
24+
</ItemGroup>
25+
2126
</Project>

OnionArchitecture/OA.Test.Unit/Service/CustomerServiceTest.cs

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

OnionArchitecture/OA/Controllers/CustomerController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public async Task<IActionResult> Create(CreateCustomerCommand command)
2121
}
2222

2323
[HttpGet]
24+
[Route("")]
2425
public async Task<IActionResult> GetAll()
2526
{
2627
return Ok(await Mediator.Send(new GetAllCustomerQuery()));

OnionArchitecture/OA/OA.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
<ItemGroup>
1515
<ProjectReference Include="..\OA.Infrastructure\OA.Infrastructure.csproj" />
16-
<ProjectReference Include="..\OA.Service\OA.Service.csproj" />
1716
</ItemGroup>
1817

1918
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>

OnionArchitecture/OA/Startup.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Microsoft.Extensions.Hosting;
66
using Microsoft.Extensions.Logging;
77
using OA.Infrastructure.Extension;
8+
using OA.Service;
89
using Serilog;
910
using System.IO;
1011

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,19 @@ This whiteapp contains following features, uncheck feature need to implement yet
134134
- [x] Integration testing via NUnit
135135
- [ ] Versioning
136136
- [x] Swagger
137-
- [ ] Loggings - seriLog
137+
- [x] CQRS Pattern
138138

139139
Below features will be implemented in infrastructure layer. You can plug and play based on your project.
140140

141+
- [x] Loggings - seriLog
142+
- [x] Email
141143
- [ ] JWT authentication
142144
- [ ] React-redux for UI
143145
- [ ] Health checks
144146
- [ ] Fluent validations
145147
- [ ] Hangfire
146-
- [ ] Email
147148
- [ ] Advanced Pagination
148-
- [ ] CQRS Pattern
149+
149150
<!-- - [ ] SignalR -->
150151

151152
## Licence Used

0 commit comments

Comments
 (0)