Skip to content

Commit 388be81

Browse files
committed
namespace change
1 parent 433b341 commit 388be81

File tree

12 files changed

+27
-27
lines changed

12 files changed

+27
-27
lines changed

src/ServiceResponse/Controller/ExtendedController.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using Microsoft.AspNetCore.Mvc;
22
using Microsoft.Extensions.Logging;
3+
using ServiceResponse.Dtos;
34
using ServiceResponse.ExceptionHandler;
45
using ServiceResponse.JsonException;
5-
using ServiceResponse.ServiceResponse;
66

77
namespace ServiceResponse.Controller;
88

@@ -19,23 +19,23 @@ protected ExtendedController(IExceptionHandler exceptionHandler, ILogger<Extende
1919

2020
public IExceptionHandler ExceptionHandler { get; set; }
2121

22-
public T SetResponse<T>(T response) where T : ServiceResponse.ServiceResponse
22+
public T SetResponse<T>(T response) where T : Dtos.ServiceResponse
2323
{
2424
Response.StatusCode = (int)response.ResponseStatus;
2525
response.Success = response.ResponseStatus == ServiceResponseStatus.Ok;
2626
return response;
2727
}
2828

29-
public Task<T> SetResponseAsync<T>(T response) where T : ServiceResponse.ServiceResponse
29+
public Task<T> SetResponseAsync<T>(T response) where T : Dtos.ServiceResponse
3030
{
3131
Response.StatusCode = (int)response.ResponseStatus;
3232
response.Success = response.ResponseStatus == ServiceResponseStatus.Ok;
3333
return Task.FromResult(response);
3434
}
3535

36-
protected ServiceResponse.ServiceResponse HandleCall(Action action)
36+
protected Dtos.ServiceResponse HandleCall(Action action)
3737
{
38-
var response = new ServiceResponse.ServiceResponse();
38+
var response = new Dtos.ServiceResponse();
3939
try
4040
{
4141
action();
@@ -50,16 +50,16 @@ protected ServiceResponse.ServiceResponse HandleCall(Action action)
5050
else
5151
{
5252
Logger?.LogError("{Message}", e);
53-
response = ExceptionHandler.Handle(new ServiceResponse.ServiceResponse(), e);
53+
response = ExceptionHandler.Handle(new Dtos.ServiceResponse(), e);
5454
}
5555
}
5656

5757
return SetResponse(response);
5858
}
5959

60-
protected async Task<ServiceResponse.ServiceResponse> ServiceResponsePaged(Func<Task> func)
60+
protected async Task<Dtos.ServiceResponse> ServiceResponsePaged(Func<Task> func)
6161
{
62-
var response = new ServiceResponse.ServiceResponse();
62+
var response = new Dtos.ServiceResponse();
6363
try
6464
{
6565
await func();
@@ -74,16 +74,16 @@ protected ServiceResponse.ServiceResponse HandleCall(Action action)
7474
else
7575
{
7676
Logger.LogError("{Message}", e);
77-
response = ExceptionHandler.Handle(new ServiceResponse.ServiceResponse(), e);
77+
response = ExceptionHandler.Handle(new Dtos.ServiceResponse(), e);
7878
}
7979
}
8080

8181
return await SetResponseAsync(response);
8282
}
8383

84-
public static ServiceResponse.ServiceResponse FromException(ServiceException e)
84+
public static Dtos.ServiceResponse FromException(ServiceException e)
8585
{
86-
var response = new ServiceResponse.ServiceResponse
86+
var response = new Dtos.ServiceResponse
8787
{
8888
ResponseStatus = e.ResponseStatus,
8989
Message = e.Message,

src/ServiceResponse/ServiceResponse/ServiceResponse.cs renamed to src/ServiceResponse/Dtos/ServiceResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace ServiceResponse.ServiceResponse;
1+
namespace ServiceResponse.Dtos;
22

33
public class ServiceResponse
44
{

src/ServiceResponse/ServiceResponse/ServiceResponsePaged.cs renamed to src/ServiceResponse/Dtos/ServiceResponsePaged.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace ServiceResponse.ServiceResponse;
1+
namespace ServiceResponse.Dtos;
22

33
public class ServiceResponsePaged<T> : ServiceResponse
44
{

src/ServiceResponse/ServiceResponse/ServiceResponseStatus.cs renamed to src/ServiceResponse/Dtos/ServiceResponseStatus.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Text.Json.Serialization;
22

3-
namespace ServiceResponse.ServiceResponse;
3+
namespace ServiceResponse.Dtos;
44

55
[JsonConverter(typeof(JsonStringEnumConverter))]
66
public enum ServiceResponseStatus

src/ServiceResponse/ExceptionHandler/DebugExceptionHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using System.Text;
2-
using ServiceResponse.ServiceResponse;
2+
using ServiceResponse.Dtos;
33

44
namespace ServiceResponse.ExceptionHandler;
55

66
public class DebugExceptionHandler : IExceptionHandler
77
{
8-
public T Handle<T>(T serviceResponse, Exception serviceException) where T : ServiceResponse.ServiceResponse
8+
public T Handle<T>(T serviceResponse, Exception serviceException) where T : Dtos.ServiceResponse
99
{
1010
if (serviceException is ServiceException exception)
1111
{

src/ServiceResponse/ExceptionHandler/IExceptionHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ namespace ServiceResponse.ExceptionHandler;
22

33
public interface IExceptionHandler
44
{
5-
T Handle<T>(T serviceResponse, Exception serviceException) where T : ServiceResponse.ServiceResponse;
5+
T Handle<T>(T serviceResponse, Exception serviceException) where T : Dtos.ServiceResponse;
66
}

src/ServiceResponse/ExceptionHandler/PublicExceptionHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
using ServiceResponse.ServiceResponse;
1+
using ServiceResponse.Dtos;
22

33
namespace ServiceResponse.ExceptionHandler;
44

55
public class PublicExceptionHandler : IExceptionHandler
66
{
7-
public T Handle<T>(T serviceResponse, Exception serviceException) where T : ServiceResponse.ServiceResponse
7+
public T Handle<T>(T serviceResponse, Exception serviceException) where T : Dtos.ServiceResponse
88
{
99
if (serviceException is ServiceException exception)
1010
{

src/ServiceResponse/ExceptionHandler/ServiceException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using ServiceResponse.ServiceResponse;
1+
using ServiceResponse.Dtos;
22

33
namespace ServiceResponse.ExceptionHandler;
44

src/ServiceResponse/Filters/ExceptionFilter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public override void OnException(ExceptionContext context)
1515
context.HttpContext.RequestServices.GetRequiredService<IExceptionHandler>();
1616
var logger = context.HttpContext.RequestServices.GetRequiredService<ILogger<ServiceExceptionFilterAttribute>>();
1717
var exception = context.Exception;
18-
ServiceResponse.ServiceResponse serviceResponse;
18+
Dtos.ServiceResponse serviceResponse;
1919

2020
if (exception is ServiceException serviceException)
2121
{
@@ -29,7 +29,7 @@ public override void OnException(ExceptionContext context)
2929
else
3030
{
3131
logger.LogError("{Message}", exception);
32-
serviceResponse = exceptionHandler.Handle(new ServiceResponse.ServiceResponse(), exception);
32+
serviceResponse = exceptionHandler.Handle(new Dtos.ServiceResponse(), exception);
3333

3434
context.Result = new ObjectResult(serviceResponse)
3535
{

src/ServiceResponse/Filters/ValidationFilter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Text;
22
using Microsoft.AspNetCore.Mvc;
33
using Microsoft.AspNetCore.Mvc.Filters;
4-
using ServiceResponse.ServiceResponse;
4+
using ServiceResponse.Dtos;
55

66
namespace ServiceResponse.Filters;
77

@@ -21,7 +21,7 @@ public override void OnActionExecuting(ActionExecutingContext context)
2121
kvp => kvp.Value!.Errors.Select(x => x.ErrorMessage))
2222
.ToArray();
2323

24-
var errorResponse = new ServiceResponse.ServiceResponse
24+
var errorResponse = new Dtos.ServiceResponse
2525
{
2626
ResponseStatus = ServiceResponseStatus.BadRequest
2727
};

0 commit comments

Comments
 (0)