3.0.1.7 Business object disposability
This commit is contained in:
@@ -66,7 +66,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App
|
||||
// Populate Repository Configuration parameters.
|
||||
private void PopulateControlParams()
|
||||
{
|
||||
using (DisposableCollection<SacsDisposable> disposables = new DisposableCollection<SacsDisposable>())
|
||||
using (DisposableCollection<ISacsDisposable> disposables = new DisposableCollection<ISacsDisposable>())
|
||||
{
|
||||
SbmcItemMgr controlItemMgr = SbmGlobals_Web.System.CreateControlItemMgr();
|
||||
if (controlItemMgr != null)
|
||||
@@ -80,14 +80,13 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App
|
||||
private void PopulateControlParams(SbmcItemMgr controlItemMgr, ItemId paramItemId)
|
||||
{
|
||||
if (!ItemId.IsValid(paramItemId)) return;
|
||||
using (DisposableCollection<SacsHierarchyItem> disposables = new DisposableCollection<SacsHierarchyItem>())
|
||||
using (DisposableCollection<ISacsDisposable> disposables = new DisposableCollection<ISacsDisposable>())
|
||||
{
|
||||
// Query item params.
|
||||
SbmcItemParam.Params prmParam = new SbmcItemParam.Params();
|
||||
prmParam.ItemIdsIncluded.Add(paramItemId);
|
||||
prmParam.StatusCat = SbmcItemParam.StatusCat.ActiveOnly;
|
||||
List<SbmcItemParam> itemParams = controlItemMgr.GetItemParamList(prmParam);
|
||||
disposables.AddRange(itemParams);
|
||||
foreach (SbmcItemParam itemParam in itemParams)
|
||||
PopulateControlParam(itemParam);
|
||||
}
|
||||
|
||||
@@ -41,11 +41,12 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Middleware
|
||||
|
||||
public async Task Invoke(HttpContext context)
|
||||
{
|
||||
String fn = GetType().Name + ".Invoke"; // SysUtil.Fn not useable.
|
||||
// Log action.
|
||||
//String rawTarget = context.Features.Get<IHttpRequestFeature>().RawTarget;
|
||||
HashSet<String> pathsToIgnore = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase) { "/Security/Ajax/ScorePassword", "/Security/Ajax/KeepLoggedIn" };
|
||||
if (SbmSystem.DebugMode && !context.Request.Method.EqualsCI("GET") && !pathsToIgnore.Contains($"{context.Request.Path}"))
|
||||
SaLogger.Debug($"{SysUtil.Fn} Action: '{Regex.Replace($"{context.Request.Path}", "^/", "")}'. Method: {context.Request.Method}.");
|
||||
SaLogger.Debug($"{fn} Action: '{Regex.Replace($"{context.Request.Path}", "^/", "")}'. Method: {context.Request.Method}.");
|
||||
|
||||
// Intercept POST requests and apply anti-forgery test.
|
||||
if (HttpMethods.IsPost(context.Request.Method))
|
||||
@@ -59,7 +60,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Middleware
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} " + ExceptionUtil.GetLogMessage(exc));
|
||||
SaLogger.Warn($"{fn} " + ExceptionUtil.GetLogMessage(exc));
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user