SlideShare a Scribd company logo
1 of 8
The answer is      1!
<#@ template #>                        The answer is      2!
<#@ output extension=“.txt” The answer is
                                        #>                3!
                                       The answer is      4!
<# for (int a=1; a<6; a++){#> answer isThe                5!
                                       Hello
The answer is <#= a #>!
<# } #>
<# SayHello(); #>
<#+ void SayHello() { #>
     public class Transform : TextTransformation
Hello{
       public string TransformText()
<#+ } #>
           {
               for (int a=1; a<6; a++){
               Write(“The answer is “);
               Write(a.ToString());
               Write (“!rn”);
               }
               SayHello();
               return GenerationEnvironment.ToString();
           }
           void SayHello()
           {
             Write(“Hello”);
           }
       }
Build include libraries

Package via NuGet

Enable scale out
T4 scaffolding
T4 scaffolding

More Related Content

More from Gareth Jones

Your API description isn't worth the paper it's written on
Your API description isn't worth the paper it's written onYour API description isn't worth the paper it's written on
Your API description isn't worth the paper it's written onGareth Jones
 
Graph API Strategies: CQRS for the API Economy
Graph API Strategies: CQRS for the API EconomyGraph API Strategies: CQRS for the API Economy
Graph API Strategies: CQRS for the API EconomyGareth Jones
 
Microsoft Education APIs
Microsoft Education APIsMicrosoft Education APIs
Microsoft Education APIsGareth Jones
 
Graph API Strategies: CQRS for the sustainable API economy
Graph API Strategies: CQRS for the sustainable API economyGraph API Strategies: CQRS for the sustainable API economy
Graph API Strategies: CQRS for the sustainable API economyGareth Jones
 
ApiDays Zurich Keynote 2017 Gareth Jones
ApiDays Zurich Keynote 2017 Gareth JonesApiDays Zurich Keynote 2017 Gareth Jones
ApiDays Zurich Keynote 2017 Gareth JonesGareth Jones
 
Gareth Jones AllAboutTheAPI KeyNote 2016
Gareth Jones AllAboutTheAPI KeyNote 2016Gareth Jones AllAboutTheAPI KeyNote 2016
Gareth Jones AllAboutTheAPI KeyNote 2016Gareth Jones
 
Running Away from JSON APIStrat 2015 Edition
Running Away from JSON APIStrat 2015 EditionRunning Away from JSON APIStrat 2015 Edition
Running Away from JSON APIStrat 2015 EditionGareth Jones
 
Running Away from JSON (or what I learned building the OneNote API)
Running Away from JSON (or what I learned building the OneNote API)Running Away from JSON (or what I learned building the OneNote API)
Running Away from JSON (or what I learned building the OneNote API)Gareth Jones
 

More from Gareth Jones (8)

Your API description isn't worth the paper it's written on
Your API description isn't worth the paper it's written onYour API description isn't worth the paper it's written on
Your API description isn't worth the paper it's written on
 
Graph API Strategies: CQRS for the API Economy
Graph API Strategies: CQRS for the API EconomyGraph API Strategies: CQRS for the API Economy
Graph API Strategies: CQRS for the API Economy
 
Microsoft Education APIs
Microsoft Education APIsMicrosoft Education APIs
Microsoft Education APIs
 
Graph API Strategies: CQRS for the sustainable API economy
Graph API Strategies: CQRS for the sustainable API economyGraph API Strategies: CQRS for the sustainable API economy
Graph API Strategies: CQRS for the sustainable API economy
 
ApiDays Zurich Keynote 2017 Gareth Jones
ApiDays Zurich Keynote 2017 Gareth JonesApiDays Zurich Keynote 2017 Gareth Jones
ApiDays Zurich Keynote 2017 Gareth Jones
 
Gareth Jones AllAboutTheAPI KeyNote 2016
Gareth Jones AllAboutTheAPI KeyNote 2016Gareth Jones AllAboutTheAPI KeyNote 2016
Gareth Jones AllAboutTheAPI KeyNote 2016
 
Running Away from JSON APIStrat 2015 Edition
Running Away from JSON APIStrat 2015 EditionRunning Away from JSON APIStrat 2015 Edition
Running Away from JSON APIStrat 2015 Edition
 
Running Away from JSON (or what I learned building the OneNote API)
Running Away from JSON (or what I learned building the OneNote API)Running Away from JSON (or what I learned building the OneNote API)
Running Away from JSON (or what I learned building the OneNote API)
 

Recently uploaded

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Recently uploaded (20)

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

T4 scaffolding

  • 1.
  • 2.
  • 3.
  • 4. The answer is 1! <#@ template #> The answer is 2! <#@ output extension=“.txt” The answer is #> 3! The answer is 4! <# for (int a=1; a<6; a++){#> answer isThe 5! Hello The answer is <#= a #>! <# } #> <# SayHello(); #> <#+ void SayHello() { #> public class Transform : TextTransformation Hello{ public string TransformText() <#+ } #> { for (int a=1; a<6; a++){ Write(“The answer is “); Write(a.ToString()); Write (“!rn”); } SayHello(); return GenerationEnvironment.ToString(); } void SayHello() { Write(“Hello”); } }
  • 5.
  • 6. Build include libraries Package via NuGet Enable scale out

Editor's Notes

  1. Every copy of Visual Studio comes with its own template code generation engine built in – T4. Come to this session to learn how to build up a library of productivity-enhancing code generators.Whether you’re creating Dependency Properties in WPF or adding custom exceptions, you can reduce the boilerplate code you need to write and minimize defects along the way. But how do you share these time-savers with your team and with the community? How can you customize them without the gotchas of copy and paste reuse?I’ll show you how to build a clean library, package it for sharing in the IDE and add extensibility points so you can customize as you go.
  2. Any questions beforehand…