Rename salesbook
This commit is contained in:
19
salesbook.Shared/Core/Helpers/ObjectExtensions.cs
Normal file
19
salesbook.Shared/Core/Helpers/ObjectExtensions.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Collections;
|
||||
|
||||
namespace salesbook.Shared.Core.Helpers;
|
||||
|
||||
public static class ObjectExtensions
|
||||
{
|
||||
public static bool IsNullOrEmpty(this IEnumerable? obj) =>
|
||||
obj == null || obj.GetEnumerator().MoveNext() == false;
|
||||
|
||||
|
||||
public static bool IsNullOrEmpty(this string? obj) =>
|
||||
string.IsNullOrEmpty(obj);
|
||||
|
||||
public static bool EqualsIgnoreCase(this string obj, string anotherString) =>
|
||||
string.Equals(obj, anotherString, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
public static bool ContainsIgnoreCase(this string obj, string anotherString) =>
|
||||
obj.Contains(anotherString, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
Reference in New Issue
Block a user