1
This commit is contained in:
@@ -48,7 +48,7 @@ namespace Tnb.WarehouseMgr
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
public class BaseWareHouseService : IOverideVisualDevService, IDynamicApiController, ITransient
|
||||
{
|
||||
private static Lazy<Dictionary<string, IWHStorageService>> _stroageMap;
|
||||
private static Lazy<Dictionary<string, IWHStorageService>> _stroageMapLazy;
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
private readonly ChannelWriter<NotifyMessage> _channelWriter;
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
static BaseWareHouseService()
|
||||
{
|
||||
_stroageMap = new Lazy<Dictionary<string, IWHStorageService>>(() =>
|
||||
_stroageMapLazy = new Lazy<Dictionary<string, IWHStorageService>>(() =>
|
||||
{
|
||||
Dictionary<string, IWHStorageService> map = new(StringComparer.OrdinalIgnoreCase);
|
||||
var serviceTypes = App.EffectiveTypes.Where(u => u.IsClass && !u.IsInterface && !u.IsAbstract && typeof(IWHStorageService).IsAssignableFrom(u)).ToList();
|
||||
@@ -140,9 +140,9 @@ namespace Tnb.WarehouseMgr
|
||||
[NonAction]
|
||||
protected async Task DoUpdate(WareHouseUpInput input)
|
||||
{
|
||||
if (_stroageMap.Value.ContainsKey(input.loginType))
|
||||
if (_stroageMapLazy.Value.ContainsKey(input.loginType))
|
||||
{
|
||||
await _stroageMap.Value[input.loginType].Do(input);
|
||||
await _stroageMapLazy.Value[input.loginType].Do(input);
|
||||
}
|
||||
}
|
||||
[NonAction]
|
||||
|
||||
Reference in New Issue
Block a user