| using Microsoft.AspNetCore.Mvc; | using Microsoft.AspNetCore.Mvc; | ||||
| using BlackRock.Reporting.API.Mediator.DocumentMediator; | using BlackRock.Reporting.API.Mediator.DocumentMediator; | ||||
| using BlackRock.Reporting.API.Core.Models; | using BlackRock.Reporting.API.Core.Models; | ||||
| using Microsoft.AspNetCore.Authorization; | |||||
| using BlackRock.Reporting.API.Exceptions; | |||||
| namespace BlackRock.Reporting.API.Controllers | namespace BlackRock.Reporting.API.Controllers | ||||
| { | { | ||||
| [HttpGet] | [HttpGet] | ||||
| public async Task<IActionResult> GetDocuments(SortFilter query) | public async Task<IActionResult> GetDocuments(SortFilter query) | ||||
| { | { | ||||
| throw new DomainException("Relay"); | |||||
| var result = await mediator.GetDocuments(query); | var result = await mediator.GetDocuments(query); | ||||
| if (!result.IsSuccess) | if (!result.IsSuccess) | ||||
| return BadRequest(); | return BadRequest(); |
| using System.Linq.Expressions; | using System.Linq.Expressions; | ||||
| using BlackRock.Reporting.API.Core.Models; | using BlackRock.Reporting.API.Core.Models; | ||||
| namespace BlackRock.Reporting.API.Extensions | |||||
| namespace BlackRock.Reporting.API.Core.Extensions | |||||
| { | { | ||||
| public static class IQueryableExtensions | public static class IQueryableExtensions | ||||
| { | { |
| using BlackRock.Reporting.API.Core.Repositories; | |||||
| namespace BlackRock.Reporting.API.Core | namespace BlackRock.Reporting.API.Core | ||||
| { | { | ||||
| public interface IUnitOfWork | public interface IUnitOfWork |
| 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 IRepository<TEntity> where TEntity : class, IBaseEntity | public interface IRepository<TEntity> where TEntity : class, IBaseEntity | ||||
| { | { |
| using BlackRock.Reporting.API.Core.Models; | 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> | public interface IUsersRepository : IRepository<User> | ||||
| { | { |
| 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)); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } |
| 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)); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } |
| namespace BlackRock.Reporting.API.Exceptions | |||||
| { | |||||
| public class DomainException : Exception | |||||
| { | |||||
| public DomainException(string? message) : base(message) | |||||
| { | |||||
| } | |||||
| public DomainException(string? message, Exception? innerException) : base(message, innerException) | |||||
| { | |||||
| } | |||||
| } | |||||
| } |
| 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); | |||||
| } | |||||
| } | |||||
| } |
| 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 | |||||
| }; | |||||
| } | |||||
| } | |||||
| } |
| 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()); | |||||
| } | |||||
| } | |||||
| } |
| 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()); | |||||
| } | |||||
| }); | |||||
| }); | |||||
| } | |||||
| } | |||||
| } |
| namespace BlackRock.Reporting.API.Exceptions | |||||
| { | |||||
| public interface IExceptionHandler | |||||
| { | |||||
| public Error HandleException(Exception exception); | |||||
| } | |||||
| } |
| namespace BlackRock.Reporting.API.Exceptions | |||||
| { | |||||
| public class ResourceNotFoundException : Exception | |||||
| { | |||||
| public ResourceNotFoundException(string? message) : base(message) | |||||
| { | |||||
| } | |||||
| public ResourceNotFoundException(string? message, Exception? innerException) : base(message, innerException) | |||||
| { | |||||
| } | |||||
| } | |||||
| } |
| namespace BlackRock.Reporting.API.Jwt | |||||
| { | |||||
| public class AuthenticationResponse | |||||
| { | |||||
| public string JwtToken { get; set; } | |||||
| public string RefreshToken { get; set; } | |||||
| } | |||||
| } |
| 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); | |||||
| } | |||||
| } | |||||
| } |
| 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; | |||||
| } | |||||
| } | |||||
| } |
| 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; | |||||
| } | |||||
| } | |||||
| } |
| 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); | |||||
| } | |||||
| } | |||||
| } |
| 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); | |||||
| } | |||||
| } | |||||
| } |
| 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); | |||||
| } | |||||
| } | |||||
| } | |||||
| } |
| } | } | ||||
| catch (Exception ex) | 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" | |||||
| }; | |||||
| } | } | ||||
| } | } | ||||
| } | } |
| } | } | ||||
| catch (Exception ex) | 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" }; | |||||
| } | } | ||||
| } | } | ||||
| } | } |
| using BlackRock.Reporting.API.Mediator.UserMediator.Model; | using BlackRock.Reporting.API.Mediator.UserMediator.Model; | ||||
| using BlackRock.Reporting.API.Mediator.UserMediator.Dto; | using BlackRock.Reporting.API.Mediator.UserMediator.Dto; | ||||
| namespace BlackRock.Reporting.API.Mapping.DTOToEntity | |||||
| namespace BlackRock.Reporting.API.Mediator.Mapping.DTOToEntity | |||||
| { | { | ||||
| public class PDFMapping : Profile | public class PDFMapping : Profile |
| using BlackRock.Reporting.API.Mediator.UserMediator.Dto; | using BlackRock.Reporting.API.Mediator.UserMediator.Dto; | ||||
| using BlackRock.Reporting.API.Mediator.UserMediator.Model; | using BlackRock.Reporting.API.Mediator.UserMediator.Model; | ||||
| namespace BlackRock.Reporting.API.Mapping | |||||
| namespace BlackRock.Reporting.API.Mediator.Mapping | |||||
| { | { | ||||
| public class UserMappingDTOToEntity : Profile | public class UserMappingDTOToEntity : Profile | ||||
| { | { |
| using BlackRock.Reporting.API.Mediator.UserMediator.Dto; | using BlackRock.Reporting.API.Mediator.UserMediator.Dto; | ||||
| using BlackRock.Reporting.API.Mediator.UserMediator.Model; | using BlackRock.Reporting.API.Mediator.UserMediator.Model; | ||||
| namespace BlackRock.Reporting.API.Mapping.DomainToDTO | |||||
| namespace BlackRock.Reporting.API.Mediator.Mapping.DomainToDTO | |||||
| { | { | ||||
| public class UserMappingDomainToDTO : Profile | public class UserMappingDomainToDTO : Profile | ||||
| { | { |
| using BlackRock.Reporting.API.Core; | using BlackRock.Reporting.API.Core; | ||||
| using BlackRock.Reporting.API.Core.Models; | using BlackRock.Reporting.API.Core.Models; | ||||
| using MediatR; | using MediatR; | ||||
| using BlackRock.Reporting.API.Core.Repositories; | |||||
| namespace BlackRock.Reporting.API.Mediator.UserMediator.Queries | namespace BlackRock.Reporting.API.Mediator.UserMediator.Queries | ||||
| { | { |
| using BlackRock.Reporting.API.Core; | |||||
| using BlackRock.Reporting.API.Core.Repositories; | |||||
| using BlackRock.Reporting.API.Core.Models; | using BlackRock.Reporting.API.Core.Models; | ||||
| using Microsoft.EntityFrameworkCore; | using Microsoft.EntityFrameworkCore; | ||||
| using System.Linq.Expressions; | 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 BlackRock.Reporting.API.Core.Models; | ||||
| using Microsoft.EntityFrameworkCore; | using Microsoft.EntityFrameworkCore; | ||||
| using BlackRock.Reporting.API.Core; | using BlackRock.Reporting.API.Core; | ||||
| using BlackRock.Reporting.API.Core.Repositories; | |||||
| namespace BlackRock.Reporting.API.Persistence | namespace BlackRock.Reporting.API.Persistence | ||||
| { | { |
| using BlackRock.Reporting.API.Authentication; | using BlackRock.Reporting.API.Authentication; | ||||
| using BlackRock.Reporting.API.Core; | using BlackRock.Reporting.API.Core; | ||||
| using BlackRock.Reporting.API.Core.Models; | 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; | ||||
| using BlackRock.Reporting.API.Persistence.Repositories; | using BlackRock.Reporting.API.Persistence.Repositories; | ||||
| using MediatR; | using MediatR; |