{"id":24455660,"url":"https://github.com/skyl1te/recreating-default-methods-where-first-etc","last_synced_at":"2025-10-14T14:42:45.664Z","repository":{"id":246200813,"uuid":"820368041","full_name":"Skyl1te/Recreating-default-methods-Where-First-etc","owner":"Skyl1te","description":"The  project is a C# library that extends the functionality of `IEnumerable\u003cT\u003e` with custom extension methods.","archived":false,"fork":false,"pushed_at":"2024-06-26T10:31:57.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T07:41:32.754Z","etag":null,"topics":["csharp","extension-methods","ienumerator","net-7-0"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Skyl1te.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-26T10:28:45.000Z","updated_at":"2024-06-26T10:33:29.000Z","dependencies_parsed_at":"2024-06-26T14:26:17.059Z","dependency_job_id":null,"html_url":"https://github.com/Skyl1te/Recreating-default-methods-Where-First-etc","commit_stats":null,"previous_names":["skyl1te/recreating-default-methods-where-first-etc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Skyl1te/Recreating-default-methods-Where-First-etc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyl1te%2FRecreating-default-methods-Where-First-etc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyl1te%2FRecreating-default-methods-Where-First-etc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyl1te%2FRecreating-default-methods-Where-First-etc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyl1te%2FRecreating-default-methods-Where-First-etc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Skyl1te","download_url":"https://codeload.github.com/Skyl1te/Recreating-default-methods-Where-First-etc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyl1te%2FRecreating-default-methods-Where-First-etc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019154,"owners_count":26086682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","extension-methods","ienumerator","net-7-0"],"created_at":"2025-01-21T02:14:04.125Z","updated_at":"2025-10-14T14:42:45.637Z","avatar_url":"https://github.com/Skyl1te.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yield_Return\n\n## Overview\n\nThe `Yield_Return` project is a C# library that extends the functionality of `IEnumerable\u003cT\u003e` with custom extension methods. This project demonstrates how to create and use these methods, including implementations of common LINQ operations such as `Where`, `First`, `Any`, `All`, `Count`, and others using the `yield return` statement for deferred execution.\n\n## Features\n\n- **Print**: Prints the elements of a collection to the console.\n- **MyCount**: Returns the number of elements in a collection.\n- **MyWhere**: Filters elements of a collection based on a predicate.\n- **MyFirst**: Returns the first element in a collection that satisfies a specified condition.\n- **MyAny**: Checks if any element in a collection satisfies a specified condition.\n- **MyAll**: Checks if all elements in a collection satisfy a specified condition.\n- **MyCountOf**: Returns the number of elements in a collection that satisfy a specified condition.\n- **MyLast**: Returns the last element in a collection that satisfies a specified condition.\n\n## Getting Started\n\n### Prerequisites\n\n- .NET SDK\n\n### Installation\n\nClone the repository:\n\n```bash\ngit clone https://github.com/yourusername/Yield_Return.git\ncd Yield_Return\n```\n\n### Usage\n\nCreate a new C# project or open an existing one. Add a reference to the `Yield_Return` library. \n\nHere is an example demonstrating how to use the custom extension methods:\n\n```csharp\nusing System;\nusing System.Collections.Generic;\nusing Yield_Return;\n\nnamespace Example\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            string[] words = { \"adsad\", \"sdasdsa\", \"qqqqe\" };\n            Console.WriteLine(words.MyCount());\n\n            Console.WriteLine(\"----------------\");\n\n            int[] nums = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };\n            foreach (int num in nums.MyWhere(i =\u003e i % 2 == 0))\n            {\n                Console.WriteLine(num);\n            }\n\n            Console.WriteLine(\"----------------\");\n\n            Console.WriteLine(nums.MyFirst(i =\u003e i % 2 == 0));\n\n            Console.WriteLine(\"----------------\");\n\n            Console.WriteLine(nums.MyCountOf(i =\u003e i % 2 == 0));\n\n            Console.WriteLine(\"----------------\");\n\n            Console.WriteLine(nums.MyLast(i =\u003e i % 2 == 0));\n        }\n    }\n}\n```\n\n### Methods\n\n#### `Print\u003cT\u003e(this IEnumerable\u003cT\u003e collection)`\n\nPrints the elements of the collection to the console.\n\n```csharp\npublic static void Print\u003cT\u003e(this IEnumerable\u003cT\u003e collection)\n```\n\n#### `MyCount\u003cT\u003e(this IEnumerable\u003cT\u003e collection)`\n\nReturns the number of elements in the collection.\n\n```csharp\npublic static int MyCount\u003cT\u003e(this IEnumerable\u003cT\u003e collection)\n```\n\n#### `MyWhere\u003cT\u003e(this IEnumerable\u003cT\u003e collection, Func\u003cT, bool\u003e func)`\n\nFilters elements of the collection based on a predicate.\n\n```csharp\npublic static IEnumerable\u003cT\u003e MyWhere\u003cT\u003e(this IEnumerable\u003cT\u003e collection, Func\u003cT, bool\u003e func)\n```\n\n#### `MyFirst\u003cT\u003e(this IEnumerable\u003cT\u003e collection, Func\u003cT, bool\u003e func)`\n\nReturns the first element in the collection that satisfies a specified condition.\n\n```csharp\npublic static T MyFirst\u003cT\u003e(this IEnumerable\u003cT\u003e collection, Func\u003cT, bool\u003e func)\n```\n\n#### `MyAny\u003cT\u003e(this IEnumerable\u003cT\u003e collection, Func\u003cT, bool\u003e func)`\n\nChecks if any element in the collection satisfies a specified condition.\n\n```csharp\npublic static bool MyAny\u003cT\u003e(this IEnumerable\u003cT\u003e collection, Func\u003cT, bool\u003e func)\n```\n\n#### `MyAll\u003cT\u003e(this IEnumerable\u003cT\u003e collection, Func\u003cT, bool\u003e func)`\n\nChecks if all elements in the collection satisfy a specified condition.\n\n```csharp\npublic static bool MyAll\u003cT\u003e(this IEnumerable\u003cT\u003e collection, Func\u003cT, bool\u003e func)\n```\n\n#### `MyCountOf\u003cT\u003e(this IEnumerable\u003cT\u003e collection, Func\u003cT, bool\u003e func)`\n\nReturns the number of elements in the collection that satisfy a specified condition.\n\n```csharp\npublic static int MyCountOf\u003cT\u003e(this IEnumerable\u003cT\u003e collection, Func\u003cT, bool\u003e func)\n```\n\n#### `MyLast\u003cT\u003e(this IEnumerable\u003cT\u003e collection, Func\u003cT, bool\u003e func)`\n\nReturns the last element in the collection that satisfies a specified condition.\n\n```csharp\npublic static T MyLast\u003cT\u003e(this IEnumerable\u003cT\u003e collection, Func\u003cT, bool\u003e func)\n```\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyl1te%2Frecreating-default-methods-where-first-etc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyl1te%2Frecreating-default-methods-where-first-etc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyl1te%2Frecreating-default-methods-where-first-etc/lists"}