Sfoglia il codice sorgente

Refactoring code for clean architecture

master
Safet Purkovic 4 anni fa
parent
commit
31b66aec35
33 ha cambiato i file con 22 aggiunte e 583 eliminazioni
  1. BIN
      BlackRock.Reporting.API/BlackRock.db-shm
  2. BIN
      BlackRock.Reporting.API/BlackRock.db-wal
  3. 0
    3
      BlackRock.Reporting.API/Controllers/DocumentsController.cs
  4. 1
    1
      BlackRock.Reporting.API/Core/Extensions/IQueryableExtensions.cs
  5. 2
    0
      BlackRock.Reporting.API/Core/IUnitOfWork.cs
  6. 1
    1
      BlackRock.Reporting.API/Core/Repositories/IRepository.cs
  7. 1
    2
      BlackRock.Reporting.API/Core/Repositories/IUsersRepository.cs
  8. 0
    38
      BlackRock.Reporting.API/Exceptions/ApplicationExceptionMiddleware.cs
  9. 0
    69
      BlackRock.Reporting.API/Exceptions/ApplicationExceptionMiddlewareBase.cs
  10. 0
    13
      BlackRock.Reporting.API/Exceptions/DomainException.cs
  11. 0
    15
      BlackRock.Reporting.API/Exceptions/Error.cs
  12. 0
    59
      BlackRock.Reporting.API/Exceptions/ExceptionHandler.cs
  13. 0
    42
      BlackRock.Reporting.API/Exceptions/ExceptionMiddleware.cs
  14. 0
    30
      BlackRock.Reporting.API/Exceptions/ExceptionMiddlewareExtensions.cs
  15. 0
    8
      BlackRock.Reporting.API/Exceptions/IExceptionHandler.cs
  16. 0
    13
      BlackRock.Reporting.API/Exceptions/ResourceNotFoundException.cs
  17. 0
    8
      BlackRock.Reporting.API/Jwt/AuthenticationResponse.cs
  18. 0
    59
      BlackRock.Reporting.API/Jwt/BasicAuthenticationOptions.cs
  19. 0
    35
      BlackRock.Reporting.API/Jwt/Filters/AddChallengeOnUnauthorizedResult.cs
  20. 0
    34
      BlackRock.Reporting.API/Jwt/Filters/AuthenticationFailureResult.cs
  21. 0
    28
      BlackRock.Reporting.API/Jwt/Filters/HttpAuthenticationChallengeContextExtensions.cs
  22. 0
    95
      BlackRock.Reporting.API/Jwt/Filters/JwtAuthenticationAttribute.cs
  23. 0
    17
      BlackRock.Reporting.API/Jwt/RefreshTokenGenerator.cs
  24. 6
    2
      BlackRock.Reporting.API/Mediator/AuthenticationMediator/Commands/LogoutCommand.cs
  25. 2
    2
      BlackRock.Reporting.API/Mediator/AuthenticationMediator/Commands/RefreshCommand.cs
  26. 1
    1
      BlackRock.Reporting.API/Mediator/Mapping/DTOToEntity/PDFMapping.cs
  27. 1
    1
      BlackRock.Reporting.API/Mediator/Mapping/DTOToEntity/UserMappingDTOToEntity.cs
  28. 1
    1
      BlackRock.Reporting.API/Mediator/Mapping/DomainToDTO/UserMappingDomainToDTO.cs
  29. 1
    0
      BlackRock.Reporting.API/Mediator/UserMediator/Queries/GetUserQuery.cs
  30. 1
    1
      BlackRock.Reporting.API/Persistence/Repositories/EFRepository.cs
  31. 2
    2
      BlackRock.Reporting.API/Persistence/Repositories/UsersRepository.cs
  32. 1
    0
      BlackRock.Reporting.API/Persistence/UnitOfWork.cs
  33. 1
    3
      BlackRock.Reporting.API/Program.cs

BIN
BlackRock.Reporting.API/BlackRock.db-shm Vedi File


BIN
BlackRock.Reporting.API/BlackRock.db-wal Vedi File


+ 0
- 3
BlackRock.Reporting.API/Controllers/DocumentsController.cs Vedi File

@@ -2,8 +2,6 @@
using Microsoft.AspNetCore.Mvc;
using BlackRock.Reporting.API.Mediator.DocumentMediator;
using BlackRock.Reporting.API.Core.Models;
using Microsoft.AspNetCore.Authorization;
using BlackRock.Reporting.API.Exceptions;

namespace BlackRock.Reporting.API.Controllers
{
@@ -33,7 +31,6 @@ namespace BlackRock.Reporting.API.Controllers
[HttpGet]
public async Task<IActionResult> GetDocuments(SortFilter query)
{
throw new DomainException("Relay");
var result = await mediator.GetDocuments(query);
if (!result.IsSuccess)
return BadRequest();

BlackRock.Reporting.API/Extensions/IQueryableExtensions.cs → BlackRock.Reporting.API/Core/Extensions/IQueryableExtensions.cs Vedi File

@@ -1,7 +1,7 @@
using System.Linq.Expressions;
using BlackRock.Reporting.API.Core.Models;

namespace BlackRock.Reporting.API.Extensions
namespace BlackRock.Reporting.API.Core.Extensions
{
public static class IQueryableExtensions
{

+ 2
- 0
BlackRock.Reporting.API/Core/IUnitOfWork.cs Vedi File

@@ -1,3 +1,5 @@
using BlackRock.Reporting.API.Core.Repositories;

namespace BlackRock.Reporting.API.Core
{
public interface IUnitOfWork

BlackRock.Reporting.API/Core/IRepository.cs → BlackRock.Reporting.API/Core/Repositories/IRepository.cs Vedi File

@@ -1,6 +1,6 @@
using BlackRock.Reporting.API.Core.Models;

namespace BlackRock.Reporting.API.Core
namespace BlackRock.Reporting.API.Core.Repositories
{
public interface IRepository<TEntity> where TEntity : class, IBaseEntity
{

BlackRock.Reporting.API/Core/IUsersRepository.cs → BlackRock.Reporting.API/Core/Repositories/IUsersRepository.cs Vedi File

@@ -1,7 +1,6 @@
using BlackRock.Reporting.API.Core.Models;
using BlackRock.Reporting.API.Core.Models;

namespace BlackRock.Reporting.API.Core
namespace BlackRock.Reporting.API.Core.Repositories
{
public interface IUsersRepository : IRepository<User>
{

+ 0
- 38
BlackRock.Reporting.API/Exceptions/ApplicationExceptionMiddleware.cs Vedi File

@@ -1,38 +0,0 @@
using System.Net.Mime;
using System.Text.Json;

namespace BlackRock.Reporting.API.Exceptions
{
public class ApplicationExceptionMiddleware
{
private readonly RequestDelegate next;
private readonly IExceptionHandler exceptionHandler;
private readonly ILogger<ApplicationExceptionMiddleware> logger;

public ApplicationExceptionMiddleware(RequestDelegate next,IExceptionHandler exceptionHandler,ILogger<ApplicationExceptionMiddleware> logger)
{
this.next = next;
this.exceptionHandler = exceptionHandler;
this.logger = logger;
}

public async Task InvokeAsync(HttpContext httpContext)
{
try
{
await next(httpContext);
}
catch (Exception ex)
{
var error = exceptionHandler.HandleException(ex);
if(!httpContext.Response.HasStarted)
{
httpContext.Response.Clear();
httpContext.Response.ContentType = MediaTypeNames.Application.Json;
httpContext.Response.StatusCode = (int)error.StatusCode;
await httpContext.Response.WriteAsync(JsonSerializer.Serialize(error));
}
}
}
}
}

+ 0
- 69
BlackRock.Reporting.API/Exceptions/ApplicationExceptionMiddlewareBase.cs Vedi File

@@ -1,69 +0,0 @@
using System.Net;
using System.Net.Mime;
using System.Text.Json;

namespace BlackRock.Reporting.API.Exceptions
{
public class ExceptionMiddleware
{
private readonly RequestDelegate _next;
private readonly ILoggingBuilder _logger;
public ExceptionMiddleware(RequestDelegate next, ILoggingBuilder logger)
{
_logger = logger;
_next = next;
}
public async Task InvokeAsync(HttpContext httpContext)
{
try
{
await _next(httpContext);
}
catch (Exception ex)
{
//_logger.LogError($"Something went wrong: {ex}");
await HandleExceptionAsync(httpContext, ex);
}
}
private async Task HandleExceptionAsync(HttpContext context, Exception exception)
{
context.Response.ContentType = "application/json";
context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
await context.Response.WriteAsync(new Error()
{
StatusCode = (HttpStatusCode)context.Response.StatusCode,
Title = "Internal Server Error from the custom middleware."
}.ToString());
}
}
public class ApplicationExceptionMiddlewareBase
{
private readonly RequestDelegate next;
private readonly IExceptionHandler exceptionHandler;
private readonly ILogger<ApplicationExceptionMiddleware> logger;
public ApplicationExceptionMiddlewareBase(RequestDelegate next, IExceptionHandler exceptionHandler, ILogger<ApplicationExceptionMiddleware> logger)
{
this.next = next;
this.exceptionHandler = exceptionHandler;
this.logger = logger;
}
public async Task InvokeAsync(HttpContext httpContext)
{
try
{
await next(httpContext);
}
catch (Exception ex)
{
var error = exceptionHandler.HandleException(ex);
if (!httpContext.Response.HasStarted)
{
httpContext.Response.Clear();
httpContext.Response.ContentType = MediaTypeNames.Application.Json;
httpContext.Response.StatusCode = (int)error.StatusCode;
await httpContext.Response.WriteAsync(JsonSerializer.Serialize(error));
}
}
}
}
}

+ 0
- 13
BlackRock.Reporting.API/Exceptions/DomainException.cs Vedi File

@@ -1,13 +0,0 @@
namespace BlackRock.Reporting.API.Exceptions
{
public class DomainException : Exception
{
public DomainException(string? message) : base(message)
{
}

public DomainException(string? message, Exception? innerException) : base(message, innerException)
{
}
}
}

+ 0
- 15
BlackRock.Reporting.API/Exceptions/Error.cs Vedi File

@@ -1,15 +0,0 @@
using System.Net;
using System.Text.Json;

namespace BlackRock.Reporting.API.Exceptions
{
public class Error
{
public string Title { get; set; }
public HttpStatusCode StatusCode { get; set; }
public override string ToString()
{
return JsonSerializer.Serialize(this);
}
}
}

+ 0
- 59
BlackRock.Reporting.API/Exceptions/ExceptionHandler.cs Vedi File

@@ -1,59 +0,0 @@
using System.Net;

namespace BlackRock.Reporting.API.Exceptions
{
public class ExceptionHandler : IExceptionHandler
{
private readonly ILogger<ExceptionHandler> logger;

public ExceptionHandler(ILogger<ExceptionHandler> logger)
{
this.logger = logger;
}
public Error HandleException(Exception exception)
{
var error = exception switch
{
DomainException domainException => HandleDomainException(domainException),
ResourceNotFoundException resourceNotFoundException => HandleResourceNotFoundException(resourceNotFoundException)
};

return error;
}

private Error HandleResourceNotFoundException(ResourceNotFoundException resourceNotFoundException)
{
logger.LogInformation(resourceNotFoundException, resourceNotFoundException.Message);

return
new Error
{
Title = resourceNotFoundException.Message,
StatusCode = HttpStatusCode.BadRequest
};
}

private Error HandleDomainException(DomainException domainException)
{
logger.LogInformation(domainException, domainException.Message);

return
new Error
{
Title = domainException.Message,
StatusCode = HttpStatusCode.BadRequest
};
}
private Error HandleUnhandledException(Exception exception)
{
logger.LogInformation(exception, exception.Message);

return
new Error
{
Title = exception.Message,
StatusCode = HttpStatusCode.InternalServerError
};
}
}
}

+ 0
- 42
BlackRock.Reporting.API/Exceptions/ExceptionMiddleware.cs Vedi File

@@ -1,42 +0,0 @@
using System.Net;

namespace BlackRock.Reporting.API.Exceptions
{
public class BRExceptionMiddleware
{
private readonly RequestDelegate _next;
private readonly ILoggingBuilder _logger;
public BRExceptionMiddleware(RequestDelegate next, ILoggingBuilder logger)
{
_logger = logger;
_next = next;
}
public async Task InvokeAsync(HttpContext httpContext)
{
try
{
await _next(httpContext);
}
catch (Exception ex)
{
//_logger.LogError($"Something went wrong: {ex}");
await HandleExceptionAsync(httpContext, ex);
}
}
private async Task HandleExceptionAsync(HttpContext context, Exception exception)
{
context.Response.ContentType = "application/json";
context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
var message = exception switch
{
DomainException => "Access violation error from the custom middleware",
_ => "Internal Server Error from the custom middleware."
};
await context.Response.WriteAsync(new Error()
{
StatusCode = (HttpStatusCode)context.Response.StatusCode,
Title = message
}.ToString());
}
}
}

+ 0
- 30
BlackRock.Reporting.API/Exceptions/ExceptionMiddlewareExtensions.cs Vedi File

@@ -1,30 +0,0 @@
using Microsoft.AspNetCore.Diagnostics;
using System.Net;

namespace BlackRock.Reporting.API.Exceptions
{
public static class ExceptionMiddlewareExtensions
{
public static void ConfigureExceptionHandler(this IApplicationBuilder app, ILoggingBuilder logger)
{
app.UseExceptionHandler(appError =>
{
appError.Run(async context =>
{
context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
context.Response.ContentType = "application/json";
var contextFeature = context.Features.Get<IExceptionHandlerFeature>();
if (contextFeature != null)
{
//logger.LogError($"Something went wrong: {contextFeature.Error}");
await context.Response.WriteAsync(new Error()
{
StatusCode = (HttpStatusCode)context.Response.StatusCode,
Title = "Internal Server Error from Custom MiidleWare"
}.ToString());
}
});
});
}
}
}

+ 0
- 8
BlackRock.Reporting.API/Exceptions/IExceptionHandler.cs Vedi File

@@ -1,8 +0,0 @@
namespace BlackRock.Reporting.API.Exceptions
{

public interface IExceptionHandler
{
public Error HandleException(Exception exception);
}
}

+ 0
- 13
BlackRock.Reporting.API/Exceptions/ResourceNotFoundException.cs Vedi File

@@ -1,13 +0,0 @@
namespace BlackRock.Reporting.API.Exceptions
{
public class ResourceNotFoundException : Exception
{
public ResourceNotFoundException(string? message) : base(message)
{
}

public ResourceNotFoundException(string? message, Exception? innerException) : base(message, innerException)
{
}
}
}

+ 0
- 8
BlackRock.Reporting.API/Jwt/AuthenticationResponse.cs Vedi File

@@ -1,8 +0,0 @@
namespace BlackRock.Reporting.API.Jwt
{
public class AuthenticationResponse
{
public string JwtToken { get; set; }
public string RefreshToken { get; set; }
}
}

+ 0
- 59
BlackRock.Reporting.API/Jwt/BasicAuthenticationOptions.cs Vedi File

@@ -1,59 +0,0 @@
using Microsoft.AspNetCore.Authentication;
using Microsoft.Extensions.Options;
using System.Security.Claims;
using System.Text.Encodings.Web;

namespace BlackRock.Reporting.API.Jwt
{
public class BasicAuthenticationOptions : AuthenticationSchemeOptions
{
}

public class CustomAuthenticationHandler : AuthenticationHandler<BasicAuthenticationOptions>
{
public CustomAuthenticationHandler(IOptionsMonitor<BasicAuthenticationOptions> options,
ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock)
{
}

protected override async Task<AuthenticateResult> HandleAuthenticateAsync()
{
//return AuthenticateResult.Success(new AuthenticationTicket
// Principal = new System.Security.Claims.ClaimsPrincipal(),
// AuthenticationScheme = Scheme.Name
//});
if (!Request.Headers.ContainsKey("Authorization"))
return AuthenticateResult.Fail("unauthorized");

string authorizationHeader = Request.Headers["Authorization"];

if (string.IsNullOrEmpty(authorizationHeader))
return AuthenticateResult.Fail("unauthorized");

if (!authorizationHeader.StartsWith("bearer", StringComparison.OrdinalIgnoreCase))
return AuthenticateResult.Fail("unauthorized");

string token = authorizationHeader.Substring("bearer".Length).Trim();
if (string.IsNullOrEmpty(token))
return AuthenticateResult.Fail("unauthorized");
try
{
return ValidateToken(token);
}
catch (Exception ex)
{
return AuthenticateResult.Fail("unauthorize");
}
}

private AuthenticateResult ValidateToken(string token)
{
var principal = new ClaimsPrincipal();//JwtManager.GetPrincipal(token);
if (principal == null)
return AuthenticateResult.Fail("unauthorized");

AuthenticationTicket ticket = new AuthenticationTicket(principal, Scheme.Name);
return AuthenticateResult.Success(ticket);
}
}
}

+ 0
- 35
BlackRock.Reporting.API/Jwt/Filters/AddChallengeOnUnauthorizedResult.cs Vedi File

@@ -1,35 +0,0 @@
using System.Net;
using System.Net.Http.Headers;
using System.Web.Http;

namespace BlackRock.Reporting.API.Jwt.Filters
{
public class AddChallengeOnUnauthorizedResult : IHttpActionResult
{
public AddChallengeOnUnauthorizedResult(AuthenticationHeaderValue challenge, IHttpActionResult innerResult)
{
Challenge = challenge;
InnerResult = innerResult;
}

public AuthenticationHeaderValue Challenge { get; }

public IHttpActionResult InnerResult { get; }

public async Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken)
{
HttpResponseMessage response = await InnerResult.ExecuteAsync(cancellationToken);

if (response.StatusCode == HttpStatusCode.Unauthorized)
{
// Only add one challenge per authentication scheme.
if (response.Headers.WwwAuthenticate.All(h => h.Scheme != Challenge.Scheme))
{
response.Headers.WwwAuthenticate.Add(Challenge);
}
}

return response;
}
}
}

+ 0
- 34
BlackRock.Reporting.API/Jwt/Filters/AuthenticationFailureResult.cs Vedi File

@@ -1,34 +0,0 @@
using System.Net;
using System.Web.Http;

namespace BlackRock.Reporting.API.Jwt.Filters
{
public class AuthenticationFailureResult : IHttpActionResult
{
public AuthenticationFailureResult(string reasonPhrase, HttpRequestMessage request)
{
ReasonPhrase = reasonPhrase;
Request = request;
}

public string ReasonPhrase { get; }

public HttpRequestMessage Request { get; }

public Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken)
{
return Task.FromResult(Execute());
}

private HttpResponseMessage Execute()
{
HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.Unauthorized)
{
RequestMessage = Request,
ReasonPhrase = ReasonPhrase
};

return response;
}
}
}

+ 0
- 28
BlackRock.Reporting.API/Jwt/Filters/HttpAuthenticationChallengeContextExtensions.cs Vedi File

@@ -1,28 +0,0 @@
using System.Net.Http.Headers;
using System.Web.Http.Filters;

namespace BlackRock.Reporting.API.Jwt.Filters
{
public static class HttpAuthenticationChallengeContextExtensions
{
public static void ChallengeWith(this HttpAuthenticationChallengeContext context, string scheme)
{
ChallengeWith(context, new AuthenticationHeaderValue(scheme));
}

public static void ChallengeWith(this HttpAuthenticationChallengeContext context, string scheme, string parameter)
{
ChallengeWith(context, new AuthenticationHeaderValue(scheme, parameter));
}

public static void ChallengeWith(this HttpAuthenticationChallengeContext context, AuthenticationHeaderValue challenge)
{
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}

context.Result = new AddChallengeOnUnauthorizedResult(challenge, context.Result);
}
}
}

+ 0
- 95
BlackRock.Reporting.API/Jwt/Filters/JwtAuthenticationAttribute.cs Vedi File

@@ -1,95 +0,0 @@
using System.Security.Claims;
using System.Security.Principal;
using System.Web.Http.Filters;

namespace BlackRock.Reporting.API.Jwt.Filters
{
public class Authentication : Attribute, IAuthenticationFilter
{
public string Realm { get; set; }
public bool AllowMultiple => false;

public async Task AuthenticateAsync(HttpAuthenticationContext context, CancellationToken cancellationToken)
{
var request = context.Request;
var authorization = request.Headers.Authorization;

if (authorization == null || authorization.Scheme != "Bearer")
return;

if (string.IsNullOrEmpty(authorization.Parameter))
{
context.ErrorResult = new AuthenticationFailureResult("Missing Jwt Token", request);
return;
}

var token = authorization.Parameter;
var principal = await AuthenticateJwtToken(token);

if (principal == null)
context.ErrorResult = new AuthenticationFailureResult("Invalid token", request);

else
context.Principal = principal;
}

private static bool ValidateToken(string token, out string username)
{
username = null;
var simplePrinciple = new ClaimsPrincipal();// JwtManager.GetPrincipal(token);
var identity = simplePrinciple?.Identity as ClaimsIdentity;

if (identity == null)
return false;

if (!identity.IsAuthenticated)
return false;

var usernameClaim = identity.FindFirst(ClaimTypes.Name);
username = usernameClaim?.Value;

if (string.IsNullOrEmpty(username))
return false;

// More validate to check whether username exists in system

return true;
}

protected Task<IPrincipal> AuthenticateJwtToken(string token)
{
if (ValidateToken(token, out var username))
{
// based on username to get more information from database in order to build local identity
var claims = new List<Claim>
{
new Claim(ClaimTypes.Name, username)
// Add more claims if needed: Roles, ...
};

var identity = new ClaimsIdentity(claims, "Jwt");
IPrincipal user = new ClaimsPrincipal(identity);

return Task.FromResult(user);
}

return Task.FromResult<IPrincipal>(null);
}

public Task ChallengeAsync(HttpAuthenticationChallengeContext context, CancellationToken cancellationToken)
{
Challenge(context);
return Task.FromResult(0);
}

private void Challenge(HttpAuthenticationChallengeContext context)
{
string parameter = null;

if (!string.IsNullOrEmpty(Realm))
parameter = "realm=\"" + Realm + "\"";

context.ChallengeWith("Bearer", parameter);
}
}
}

+ 0
- 17
BlackRock.Reporting.API/Jwt/RefreshTokenGenerator.cs Vedi File

@@ -1,17 +0,0 @@
using System.Security.Cryptography;

namespace BlackRock.Reporting.API.Jwt
{
public static class RefreshTokenGenerator
{
public static string GenerateToken()
{
var randomNumber = new byte[32];
using (var radnomNumberGenerator = RandomNumberGenerator.Create())
{
radnomNumberGenerator.GetBytes(randomNumber);
return Convert.ToBase64String(randomNumber);
}
}
}
}

+ 6
- 2
BlackRock.Reporting.API/Mediator/AuthenticationMediator/Commands/LogoutCommand.cs Vedi File

@@ -52,8 +52,12 @@ namespace BlackRock.Reporting.API.Mediator.AuthenticationMediator.Commands
}
catch (Exception ex)
{
logger.LogError(ex, "Faild to add data to DB.");
return new Result<bool> { IsSuccess = false, Error = "Faild to add data to DB." };
logger.LogError(ex, "Invalid token");
return new Result<bool>
{
IsSuccess = false,
Error = "Invalid token"
};
}
}
}

+ 2
- 2
BlackRock.Reporting.API/Mediator/AuthenticationMediator/Commands/RefreshCommand.cs Vedi File

@@ -55,8 +55,8 @@ namespace BlackRock.Reporting.API.Mediator.AuthenticationMediator.Commands
}
catch (Exception ex)
{
logger.LogError(ex, "Faild to add data to DB.");
return new Result<CredentialsCommand> { IsSuccess = false, Error = "Faild to add data to DB." };
logger.LogError(ex, "Invalid token");
return new Result<CredentialsCommand> { IsSuccess = false, Error = "Invalid token" };
}
}
}

BlackRock.Reporting.API/Mapping/DTOToEntity/PDFMapping.cs → BlackRock.Reporting.API/Mediator/Mapping/DTOToEntity/PDFMapping.cs Vedi File

@@ -4,7 +4,7 @@ using BlackRock.Reporting.API.Core.Models;
using BlackRock.Reporting.API.Mediator.UserMediator.Model;
using BlackRock.Reporting.API.Mediator.UserMediator.Dto;

namespace BlackRock.Reporting.API.Mapping.DTOToEntity
namespace BlackRock.Reporting.API.Mediator.Mapping.DTOToEntity
{

public class PDFMapping : Profile

BlackRock.Reporting.API/Mapping/DTOToEntity/UserMappingDTOToEntity.cs → BlackRock.Reporting.API/Mediator/Mapping/DTOToEntity/UserMappingDTOToEntity.cs Vedi File

@@ -3,7 +3,7 @@ using BlackRock.Reporting.API.Core.Models;
using BlackRock.Reporting.API.Mediator.UserMediator.Dto;
using BlackRock.Reporting.API.Mediator.UserMediator.Model;

namespace BlackRock.Reporting.API.Mapping
namespace BlackRock.Reporting.API.Mediator.Mapping
{
public class UserMappingDTOToEntity : Profile
{

BlackRock.Reporting.API/Mapping/DomainToDTO/UserMappingDomainToDTO.cs → BlackRock.Reporting.API/Mediator/Mapping/DomainToDTO/UserMappingDomainToDTO.cs Vedi File

@@ -3,7 +3,7 @@ using BlackRock.Reporting.API.Core.Models;
using BlackRock.Reporting.API.Mediator.UserMediator.Dto;
using BlackRock.Reporting.API.Mediator.UserMediator.Model;

namespace BlackRock.Reporting.API.Mapping.DomainToDTO
namespace BlackRock.Reporting.API.Mediator.Mapping.DomainToDTO
{
public class UserMappingDomainToDTO : Profile
{

+ 1
- 0
BlackRock.Reporting.API/Mediator/UserMediator/Queries/GetUserQuery.cs Vedi File

@@ -4,6 +4,7 @@ using BlackRock.Reporting.API.Mediator.UserMediator.Model;
using BlackRock.Reporting.API.Core;
using BlackRock.Reporting.API.Core.Models;
using MediatR;
using BlackRock.Reporting.API.Core.Repositories;

namespace BlackRock.Reporting.API.Mediator.UserMediator.Queries
{

+ 1
- 1
BlackRock.Reporting.API/Persistence/Repositories/EFRepository.cs Vedi File

@@ -1,4 +1,4 @@
using BlackRock.Reporting.API.Core;
using BlackRock.Reporting.API.Core.Repositories;
using BlackRock.Reporting.API.Core.Models;
using Microsoft.EntityFrameworkCore;


+ 2
- 2
BlackRock.Reporting.API/Persistence/Repositories/UsersRepository.cs Vedi File

@@ -1,6 +1,6 @@
using System.Linq.Expressions;
using BlackRock.Reporting.API.Core;
using BlackRock.Reporting.API.Extensions;
using BlackRock.Reporting.API.Core.Repositories;
using BlackRock.Reporting.API.Core.Extensions;
using BlackRock.Reporting.API.Core.Models;
using Microsoft.EntityFrameworkCore;


+ 1
- 0
BlackRock.Reporting.API/Persistence/UnitOfWork.cs Vedi File

@@ -1,4 +1,5 @@
using BlackRock.Reporting.API.Core;
using BlackRock.Reporting.API.Core.Repositories;

namespace BlackRock.Reporting.API.Persistence
{

+ 1
- 3
BlackRock.Reporting.API/Program.cs Vedi File

@@ -1,9 +1,7 @@
using BlackRock.Reporting.API.Authentication;
using BlackRock.Reporting.API.Core;
using BlackRock.Reporting.API.Core.Models;
using BlackRock.Reporting.API.Exceptions;
using BlackRock.Reporting.API.Jwt;
using BlackRock.Reporting.API.Mediator.AuthenticationMediator;
using BlackRock.Reporting.API.Core.Repositories;
using BlackRock.Reporting.API.Persistence;
using BlackRock.Reporting.API.Persistence.Repositories;
using MediatR;

Loading…
Annulla
Salva