feat(esppScheduleSync, esppSync): вынесена логика сравнения nextRun из EsppSync в EsppScheduleSync. Рефакторинг EsppScheduleSync - логика проверки имени шаблона
This commit is contained in:
25
PARR.EsppSync/Helpers/EsppSyncHelpers.cs
Normal file
25
PARR.EsppSync/Helpers/EsppSyncHelpers.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
namespace PARR.EsppSync.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Хелперы для EsppSync
|
||||
/// </summary>
|
||||
public static class EsppSyncHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Првести строку в стандарт сравнения (для сравнения объектов)
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <returns></returns>
|
||||
public static string Normalize(string? str)
|
||||
{
|
||||
if (str == null)
|
||||
return string.Empty;
|
||||
|
||||
str = str.Replace("\r", string.Empty);
|
||||
str = str.Replace("\n", string.Empty);
|
||||
str = str.Replace(" ", string.Empty);
|
||||
|
||||
return str.ToLower();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user