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