From 5309798e1a2929069de369e6ee6b71c63cc3c2b0 Mon Sep 17 00:00:00 2001 From: Ali Yousefi Date: Sat, 3 Feb 2024 01:15:53 +0330 Subject: [PATCH] make GetCurrentUserUniqueIdentity virtual --- .../UnitOfWork.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/CSharp/EasyMicroservices.Cores.AspEntityFrameworkCoreApi/UnitOfWork.cs b/src/CSharp/EasyMicroservices.Cores.AspEntityFrameworkCoreApi/UnitOfWork.cs index 6609ffb..f45e925 100644 --- a/src/CSharp/EasyMicroservices.Cores.AspEntityFrameworkCoreApi/UnitOfWork.cs +++ b/src/CSharp/EasyMicroservices.Cores.AspEntityFrameworkCoreApi/UnitOfWork.cs @@ -1,5 +1,4 @@ -using Authentications.GeneratedServices; -using EasyMicroservices.Cores.AspCoreApi.Interfaces; +using EasyMicroservices.Cores.AspCoreApi.Interfaces; using EasyMicroservices.Cores.AspCoreApi.Managers; using EasyMicroservices.Cores.AspEntityFrameworkCoreApi.Interfaces; using EasyMicroservices.Cores.Database.Interfaces; @@ -16,7 +15,6 @@ using EasyMicroservices.Mapper.SerializerMapper.Providers; using EasyMicroservices.Serialization.Interfaces; using EasyMicroservices.Serialization.Newtonsoft.Json.Providers; -using EasyMicroservices.ServiceContracts; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -24,11 +22,8 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Net.Http; -using System.Security.Claims; using System.Text; using System.Threading.Tasks; -using System.Xml.Linq; namespace EasyMicroservices.Cores.AspEntityFrameworkCoreApi { @@ -404,7 +399,7 @@ public virtual Task InitializeWhiteLabel(string microserviceName, string whiteLa { var whiteLabelManager = serviceProvider.GetService(); if (!whiteLabelManager.IsInitialized) - return await whiteLabelManager.Initialize(serviceProvider.GetService(), microserviceName, whiteLabelRoute, dbContextTypes); + return await whiteLabelManager.Initialize(serviceProvider.GetService(), microserviceName, whiteLabelRoute, dbContextTypes); return whiteLabelManager.CurrentWhiteLabel; }; return Task.CompletedTask; @@ -443,10 +438,10 @@ public ITextSerializationProvider GetTextSerialization() /// /// /// - public async Task GetCurrentUserUniqueIdentity(LogicOptions logicOptions = default) + public virtual async Task GetCurrentUserUniqueIdentity(LogicOptions logicOptions = default) { await InitializeWhiteLabel(); - var httpContext = ServiceProvider.GetService()?.HttpContext; + var httpContext = ServiceProvider.GetService()?.HttpContext; if (httpContext != null) { var uniqueIdentity = httpContext.User.FindFirst(nameof(IUniqueIdentitySchema.UniqueIdentity))?.Value;