InFlux.T4 1.0.1

.NET Standard 2.1
dotnet add package InFlux.T4 --version 1.0.1
NuGet\Install-Package InFlux.T4 -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="InFlux.T4" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add InFlux.T4 --version 1.0.1
#r "nuget: InFlux.T4, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install InFlux.T4 as a Cake Addin
#addin nuget:?package=InFlux.T4&version=1.0.1

// Install InFlux.T4 as a Cake Tool
#tool nuget:?package=InFlux.T4&version=1.0.1

T4 Template Generated code

(16th December 2022)

The provided template needs its "properties" changes from "content" to "none". This will be enough to allow you to edit the file!

Open the T4 template file "ModelAdditionalCode.tt".

// PLEASE FILL THIS IN:
// --------------------
var RELATIVE_PATH_FROM_THIS_FILE = @"\TestModels\";
// ----------------------------------

It wants to point to a folder in which any model you want to enhance lives. The default folder name \TestModels\ is unlikely what you need!

Its a good idea to create a folder to isolate your partial classes that will be enhanced, away from other code where the code generator can't work on more things than you intend it to.

  • T4 templates can trigger code generation from visual studio when ever you save a change.
  • Secondly, you can right-click on a "*.tt" file and choose the "Run Custom Tool" option.

Code generation assumes you've already got InFlux as a project NuGet dependency. If not, you can get it here: <a href="https://www.nuget.org/packages/InFlux/">InFlux on NuGet</a>

future?

I don't know if I'll try to improve upon this with a code generator that integrated with Visual Studio. I have done that once already, and in my opinion, is not as easy to do, and perhaps is less maintainable. Then again, maybe that's because I've spend 12 years occassionally playing with T4 templates. I do like the convenience that the new code generators bring.
Perhaps some day?

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.1
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 88 12/16/2022

A T4 template code generator that uses InFlux to manage intended property changes
that can be 'resisted' through code, requiring confirmation from a user.  Denial results
in no property change.  Property changes can also be tracked through generated events.