Skip to content

Commit

Permalink
Add string.ContainsIgnoreCase
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-dudarev committed Feb 20, 2025
1 parent a7135b7 commit 7547260
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ public static bool EqualsIgnoreCase(this string str1, string str2)
return string.Equals(str1, str2, StringComparison.OrdinalIgnoreCase);
}

public static bool ContainsIgnoreCase(this string value, string substring)
{
return value.Contains(substring, StringComparison.OrdinalIgnoreCase);
}


public static string GetCurrencyName(this string isoCurrencySymbol)
{
Expand Down
3 changes: 2 additions & 1 deletion src/VirtoCommerce.Platform.Web/Licensing/License.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Security.Cryptography;
using System.Text;
using Newtonsoft.Json;
using VirtoCommerce.Platform.Core.Common;
using VirtoCommerce.Platform.Core.Exceptions;
using VirtoCommerce.Platform.Core.Extensions;

Expand Down Expand Up @@ -83,7 +84,7 @@ private static string ReadResourceFileWithKey(string publicKeyResourceName)
var assembly = Assembly.GetExecutingAssembly();

var resourceNames = assembly.GetManifestResourceNames();
var fullResourceName = resourceNames.FirstOrDefault(x => x.Contains(publicKeyResourceName, StringComparison.OrdinalIgnoreCase));
var fullResourceName = resourceNames.FirstOrDefault(x => x.ContainsIgnoreCase(publicKeyResourceName));

if (string.IsNullOrEmpty(fullResourceName))
{
Expand Down

0 comments on commit 7547260

Please sign in to comment.