window.ENTITIES={'/api/snippets/cs/c%23%20check%20if%20list%20is%20empty':[{"result":true,"message":null,"batch":{"type":"cs","name":"c# check if list is empty","items":[{"id":"j4WPGp","type":"cs","name":"c# check if List is empty","content":"List list = new List();\n\nbool isEmpty = !list.Any();\n\nConsole.WriteLine(isEmpty); // Output: True","source":"https://dirask.com/posts/C-NET-check-if-List-is-empty-prBqzp","author":{"id":"ZDxVGo","name":"maciek211","avatar":"1629131393518__ZDxVGo__w40px_h40px.jpg","points":425,"role":"BASIC"},"creationTime":1645816781000,"updateTime":null,"removalTime":null},{"id":"pzaExD","type":"cs","name":"c# check if List is empty","content":"List list = new List();\n\nbool isEmpty = list.Count() == 0;\n\nConsole.WriteLine(isEmpty); // Output: True","source":"https://dirask.com/posts/C-NET-check-if-List-is-empty-prBqzp","author":{"id":"4a6xA0","name":"Broncono","avatar":"1629030394463__4a6xA0__w40px_h40px.png","points":466,"role":"BASIC"},"creationTime":1645816785000,"updateTime":null,"removalTime":null},{"id":"p5q3Rp","type":"cs","name":"c# check if List is empty","content":"using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\npublic class Program\n{\n public static void Main()\n {\n List list1 = new List();\n List list2 = new List { 1, 2, 3 };\n\n Console.WriteLine(isEmpty(list1)); // Output: True\n Console.WriteLine(isEmpty(list2)); // Output: False\n }\n\n private static bool isEmpty(List list)\n {\n return !list.Any();\n }\n}","source":"https://dirask.com/posts/C-NET-check-if-List-is-empty-prBqzp","author":{"id":"7adr50","name":"Emorak","avatar":"1629059071302__7adr50__w40px_h40px.jpg","points":366,"role":"BASIC"},"creationTime":1645816787000,"updateTime":null,"removalTime":null},{"id":"1beqwj","type":"cs","name":"c# check if List is empty","content":"using System;\nusing System.Collections.Generic;\n\npublic class Program\n{\n public static void Main()\n {\n List list1 = new List();\n List list2 = new List { 1, 2, 3 };\n\n Console.WriteLine(isEmpty(list1)); // Output: True\n Console.WriteLine(isEmpty(list2)); // Output: False\n }\n\n private static bool isEmpty(List list)\n {\n return list.Count == 0;\n }\n}","source":"https://dirask.com/posts/C-NET-check-if-List-is-empty-prBqzp","author":{"id":"ZaEd2D","name":"Burhan-Boyce","avatar":"1629131214042__ZaEd2D__w40px_h40px.jpg","points":458,"role":"BASIC"},"creationTime":1645816789000,"updateTime":null,"removalTime":null}]}}]};