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);
}