{"id":13628915,"url":"https://github.com/SzymonHalucha/Minerals.AutoInterfaces","last_synced_at":"2025-04-17T04:32:33.495Z","repository":{"id":227259013,"uuid":"770855903","full_name":"SzymonHalucha/Minerals.AutoInterfaces","owner":"SzymonHalucha","description":"Package for automatic interface generation using an incremental source generator","archived":false,"fork":false,"pushed_at":"2024-05-16T09:18:58.000Z","size":96,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T00:14:47.752Z","etag":null,"topics":["csharp","csharp-sourcegenerator","dotnet","interfaces","mocking","roslyn"],"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/SzymonHalucha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-03-12T09:31:05.000Z","updated_at":"2025-03-16T16:10:43.000Z","dependencies_parsed_at":"2024-04-28T09:23:11.430Z","dependency_job_id":"c9fa6cbc-a1a4-4f89-924f-f6d74ca066c2","html_url":"https://github.com/SzymonHalucha/Minerals.AutoInterfaces","commit_stats":null,"previous_names":["szymonhalucha/minerals.autointerfaces"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SzymonHalucha%2FMinerals.AutoInterfaces","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SzymonHalucha%2FMinerals.AutoInterfaces/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SzymonHalucha%2FMinerals.AutoInterfaces/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SzymonHalucha%2FMinerals.AutoInterfaces/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SzymonHalucha","download_url":"https://codeload.github.com/SzymonHalucha/Minerals.AutoInterfaces/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249316000,"owners_count":21249872,"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","csharp-sourcegenerator","dotnet","interfaces","mocking","roslyn"],"created_at":"2024-08-01T22:00:59.436Z","updated_at":"2025-04-17T04:32:31.775Z","avatar_url":"https://github.com/SzymonHalucha.png","language":"C#","readme":"# Minerals.AutoInterfaces\n\n![GitHub License](https://img.shields.io/github/license/SzymonHalucha/Minerals.AutoInterfaces?style=for-the-badge)\n![NuGet Version](https://img.shields.io/nuget/v/Minerals.AutoInterfaces?style=for-the-badge)\n![NuGet Downloads](https://img.shields.io/nuget/dt/Minerals.AutoInterfaces?style=for-the-badge)\n\n[Package on nuget.org](https://www.nuget.org/packages/Minerals.AutoInterfaces/)\n\nThis NuGet package provides a functionality to automatically generate interfaces for C# classes with a single attribute. This simplifies the creation of interfaces for classes with clearly defined public members, without having to manually write interface code.\n\n## Features\n\n- **Automatic interface generation:** Saves time and reduces the risk of errors when creating interfaces for classes.\n- **Support for generic methods and constraints:** Allows for generating interfaces for complex classes with generic methods.\n- **Support for custom getters and setters:** Generates interfaces for properties with custom getter and setter implementations.\n- **Customizable interface name:** Allows you to name the interface according to naming conventions or user preferences.\n- **Compatible with .NET Standard 2.0 and C# 7.3+:** Works on a wide range of platforms and development environments.\n\n## Installation\n\nAdd the Minerals.AutoInterfaces nuget package to your C# project using the following methods:\n\n### 1. Project file definition\n\n```xml\n\u003cPackageReference Include=\"Minerals.AutoInterfaces\" Version=\"0.1.5\" /\u003e\n```\n\n### 2. dotnet command\n\n```bat\ndotnet add package Minerals.AutoInterfaces\n```\n\n## Usage\n\nTo use the package, add the ```[GenerateInterface]``` attribute to the selected class.\n\n```csharp\nnamespace Examples\n{\n    [Minerals.AutoInterfaces.GenerateInterface]\n    public class ExampleClass\n    {\n        public int Property1 { get; set; } = 1;\n        public int Property2 { get; private set; } = 2;\n        public int Property3\n        {\n            get { return _field1; }\n            set { _field1 = value; }\n        }\n\n        private int _field1 = 0;\n\n        public int Method1(int arg0, int arg1)\n        {\n            return arg0 + arg1;\n        }\n\n        public void Method2\u003cT\u003e(T arg0) where T : class, new()\n        {\n            return $\"{arg0}\";\n        }\n\n        protected void Method3() { }\n    }\n}\n```\n\nThe code above will generate the ```IExampleClass.g.cs``` file with the ```IExampleClass``` interface.\n\n```csharp\nnamespace Examples\n{\n    [global::System.Runtime.CompilerServices.CompilerGenerated]\n    public interface IExampleClass\n    {\n        int Property1 { get; set; }\n        int Property2 { get; }\n        int Property3 { get; set; }\n        int Method1(int arg0, int arg1);\n        string Method2\u003cT\u003e(T arg0) where T : class, new();\n    }\n}\n```\n\n### Package supports custom interface names\n\n```csharp\nnamespace Examples\n{\n    [Minerals.AutoInterfaces.GenerateInterface(\"ExampleInterface\")]\n    public class ExampleClass\n    {\n        public int Property1 { get; protected set; } = 1;\n    }\n}\n```\n\nThe code above will generate the ```ExampleInterface.g.cs``` file with the ```ExampleInterface``` interface.\n\n```csharp\nnamespace Examples\n{\n    [global::System.Runtime.CompilerServices.CompilerGenerated]\n    public interface ExampleInterface\n    {\n        int Property1 { get; }\n    }\n}\n```\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [branches on this repository](https://github.com/SzymonHalucha/Minerals.AutoInterfaces/branches).\n\n## Authors\n\n- **Szymon Hałucha** - Maintainer\n\nSee also the list of [contributors](https://github.com/SzymonHalucha/Minerals.AutoInterfaces/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.\n","funding_links":[],"categories":["Content","Source Generators"],"sub_categories":["137. [Minerals.AutoInterfaces](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Minerals.AutoInterfaces) , in the [Interface](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#interface) category","Patterns"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSzymonHalucha%2FMinerals.AutoInterfaces","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSzymonHalucha%2FMinerals.AutoInterfaces","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSzymonHalucha%2FMinerals.AutoInterfaces/lists"}