Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/konard/t4genericsexample
Generating multiple implementations of a generic interface using T4 text templates and .NET Core
https://github.com/konard/t4genericsexample
dotnet-core generics t4 text-template
Last synced: 11 days ago
JSON representation
Generating multiple implementations of a generic interface using T4 text templates and .NET Core
- Host: GitHub
- URL: https://github.com/konard/t4genericsexample
- Owner: Konard
- License: mit
- Created: 2019-05-10T22:03:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T19:35:15.000Z (over 3 years ago)
- Last Synced: 2024-10-10T13:36:16.337Z (28 days ago)
- Topics: dotnet-core, generics, t4, text-template
- Language: C#
- Homepage:
- Size: 26.4 KB
- Stars: 5
- Watchers: 5
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![CodeFactor](https://www.codefactor.io/repository/github/konard/t4genericsexample/badge)](https://www.codefactor.io/repository/github/konard/t4genericsexample)
# T4GenericsExample
This example shows how to generate multiple generic interface implementations using [T4 text templates](https://docs.microsoft.com/en-us/visualstudio/modeling/code-generation-and-t4-text-templates) implemented by [Mono/T4](https://github.com/mono/t4).
There is the `IGeneric` interface.
T4 is used to generate specific implementations of this interface for `UInt64`, `UInt32`, `UInt16` and `Byte` types.
All implementations share single base template `GenericClass.ttinclude` logic.It is possible to achieve the same result using [C++/CLI template and .NET Framework 4.7.2](https://github.com/Konard/CppGenericsExample). But this approach works only for Windows while support for C++/CLI is not crossplatform.
## Setup
Requires .NET Core 2.2 SDK and Runtime.https://dotnet.microsoft.com/download
## Run
```
dotnet run
```## Development process videos
https://www.youtube.com/playlist?list=PLeYxH0Vd8louZqRXtRXm1X3HAEYcwR4ZQ