Is ICollection Null Or Empty - CSharp System.Collections

CSharp examples for System.Collections:ICollection

Description

Is ICollection Null Or Empty

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//www  .  ja v  a  2s.  com

public class Main{
        public static bool IsNullOrEmpty<T>(this ICollection<T> collection)
        {
            return (collection == null) || (collection.Count == 0);
        }
}

Related Tutorials