11using Microsoft . AspNetCore . Mvc ;
22using Microsoft . Extensions . Logging ;
3+ using ServiceResponse . Dtos ;
34using ServiceResponse . ExceptionHandler ;
45using ServiceResponse . JsonException ;
5- using ServiceResponse . ServiceResponse ;
66
77namespace 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 ,
0 commit comments