{"id":18318809,"url":"https://github.com/alexscigalszky/interfaceextentions","last_synced_at":"2025-04-09T14:16:16.925Z","repository":{"id":188132342,"uuid":"678158047","full_name":"AlexScigalszky/InterfaceExtentions","owner":"AlexScigalszky","description":"Examples of extension methods of parametrized interfaces","archived":false,"fork":false,"pushed_at":"2023-08-13T21:56:56.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T08:14:35.642Z","etag":null,"topics":["csharp-code","extensionmethods","interfaces","parametrized"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexScigalszky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-13T21:50:05.000Z","updated_at":"2023-08-13T21:59:08.000Z","dependencies_parsed_at":"2023-08-13T23:05:47.656Z","dependency_job_id":null,"html_url":"https://github.com/AlexScigalszky/InterfaceExtentions","commit_stats":null,"previous_names":["alexscigalszky/interfaceextentions"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexScigalszky%2FInterfaceExtentions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexScigalszky%2FInterfaceExtentions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexScigalszky%2FInterfaceExtentions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexScigalszky%2FInterfaceExtentions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexScigalszky","download_url":"https://codeload.github.com/AlexScigalszky/InterfaceExtentions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054194,"owners_count":21039952,"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","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-code","extensionmethods","interfaces","parametrized"],"created_at":"2024-11-05T18:11:38.994Z","updated_at":"2025-04-09T14:16:16.891Z","avatar_url":"https://github.com/AlexScigalszky.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Extention methods using Classes and Interfaces\n\nThis repository shows how with C# we can extend parametrized classes and interfaces\n\n## IMPORTANT\n\nLook at the double implementation in the class ´Wrapper´. That's the key.\n\n```C#\npublic class Wrapper\u003cTRequest, TResponse\u003e : \n        IWrapper\u003cIRequest, IResponse\u003e, // Interface inheritance, parameterized Interface\n        IWrapper\u003cRequest, Response\u003e // Interface inheritance, parameterized Class\n        // no matter if Request implements IRequest.\n    {\n        \n    }\n```\n\nIf the class Wrapper doesn't implement the class parametrized interfaces, the tests ´Use_Interface_Interface_Extension_Test´ and ´Use_Interface_Class_Extension_Test´ won't compile.\nC# doesn't know how to cast th line\n\n```C#\n\nIWrapper\u003cRequest, Response\u003e wrapper = new Wrapper\u003cRequest, Response\u003e();\n\n```\n\nAnd you will see the error\n\n```\n\nError\tCS0266\t\nCannot implicitly convert\ntype 'InterfaceExtentions.Impl.Wrapper\u003cInterfaceExtentions.Impl.Request, InterfaceExtentions.Impl.Response\u003e' \nto 'InterfaceExtentions.Interfaces.IWrapper\u003cInterfaceExtentions.Impl.Request, InterfaceExtentions.Impl.Response\u003e'. \nAn explicit conversion exists (are you missing a cast?)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexscigalszky%2Finterfaceextentions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexscigalszky%2Finterfaceextentions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexscigalszky%2Finterfaceextentions/lists"}