feat(dal): добавлено расширение string ApplyShortcode - позволяет подставлять в строковых переменные шаблонные значения типа %ЭК%

This commit is contained in:
Mikhail Kuznetsov
2024-03-20 15:26:14 +10:00
parent ff712ed126
commit b803f8beaa
6 changed files with 54 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
using Microsoft.Extensions.Logging;
using PARR.BLL.Services.Interfaces;
using PARR.DAL.Contracts;
using PARR.DAL.Extensions;
using PARR.DAL.Models;
using PARR.EsppSync;
using PARR.EsppTemplateSync.Domain;
@@ -81,8 +82,8 @@ namespace PARR.EsppTemplateSync
Solution = template.ApplicationsInWork.Solution,
Process = template.ApplicationsInWork.Work!.Tnk!.Subprocess!.Process!.Name,
SubProcess = template.ApplicationsInWork.Work.Tnk.Subprocess.Name,
TNK = template.ApplicationsInWork.Work.Tnk.Name,
Work = template.ApplicationsInWork.Work.Name
TNK = template.ApplicationsInWork.Work.Tnk.Name.ApplyShortcode(Constants.Shortcode.Shortcodes.EK, template.Host.Ek),
Work = template.ApplicationsInWork.Work.Name.ApplyShortcode(Constants.Shortcode.Shortcodes.EK, template.Host.Ek)
};
return templateFromDb;
@@ -106,7 +107,7 @@ namespace PARR.EsppTemplateSync
var templateName = splittedContent[0].Trim();
var currentCulture = Thread.CurrentThread.CurrentCulture;
//if (!string.IsNullOrEmpty(settingsFromDb.TemplatePrefixName) || !templateName.StartsWith(settingsFromDb.TemplatePrefixName, true, currentCulture))
if (string.IsNullOrEmpty(settingsFromDb.TemplatePrefixWithoutVariable) || !templateName.Contains(settingsFromDb.TemplatePrefixWithoutVariable)) // , StringComparison.CurrentCultureIgnoreCase
{