Giter Club home page Giter Club logo

t4genericsexample's Introduction

CodeFactor

T4GenericsExample

This example shows how to generate multiple generic interface implementations using T4 text templates implemented by Mono/T4. There is the IGeneric<T> 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. 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

t4genericsexample's People

Contributors

konard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

t4genericsexample's Issues

Question: did you try to package your project and check how it plays on consumer side?

First, thanks for the useful example.
I was searching for the one working in .Core.

I have my own T4 (MS VS based) solution in https://github.com/dadhi/DryIoc/blob/master/src/DryIoc/Container.Generated.tt,
but it does not work in .Net Core, and randomly works at all.
The main problem is that I want to publish tt and ttinclude files to content-based nuget package, and find a multiple issues on the package consumer side, like wrong pathes, unable to load assemblies, etc.

Did you try to package you project and check what's happening on the other side?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.