SlideShare a Scribd company logo
http://geekswithblogs.net/mrad
radacz.mcp@gmail.com
…generate “starter” code…

…provide a extensibility mechanism to customize
generated code…

…generate more than just MVC Controllers and
Views…
Install-Package MvcScaffolding



Scaffold Controller Product
Invoke-Scaffolder



   “Scaffold” Alias


       scaffoldingTabExpansion
       (context command line switch)
Action       • MvcScaffolding.Action

  Controller     • MvcScaffolding.Controller

CustomScaffold   • T4Scaffolding.CustomScaffolder

CustomTemplate   • T4Scaffolding.CustomTemplate

  DbContext      • T4Scaffolding.EFDbContext

  Repository     • T4Scaffolding.EFRepository

   UnitTest      • MvcScaffolding.ActionUnitTest

    View         • MvcScaffolding.RazorView

    Views        • MvcScaffolding.Views
Get-DefaultScaffolder Controller

Set-DefaultScaffolder Controller MvcScaffolding.ControllerWithRepository
Action:
Scaffold Action -Controller TasksController -Action Foo -ViewModel Task

Unit Test:
Scaffold UnitTest -Controller TasksController -Action Create

Both in 1 shot:
Scaffold MvcScaffolding.ActionWithUnitTest -Controller TasksController -Action
ArchiveTask -ViewModel Task
Scaffold CustomTemplate <ScaffolderName> <TemplateName>

Scaffold CustomTemplate View Index
Add-                            Add-
 Add-ClassMember                                                                         Find-ScaffolderTemplate            Get-DefaultScaffolder
                            ClassMemberViaTemplate        ProjectItemViaTemplate




                                                                   Get-
Get-PluralizedWord              Get-PrimaryKey                                               Get-ProjectFolder                Get-ProjectItem
                                                         ProjectAspNetMvcVersion




Get-ProjectLanguage             Get-ProjectType             Get-RelatedEntities               Get-Scaffolder                Get-SingularizedWord




                Invoke-Scaffolder          Invoke-ScaffoldTemplate         Set-DefaultScaffolder               Set-IsCheckedOut
Whether n00b(ie) or Expert:
Scaffolding should be a tool in your
              toolbox!
http://blog.stevensanderson.com/2011/01/13/scaffold-your-
aspnet-mvc-3-project-with-the-mvcscaffolding-package/

http://mvcscaffolding.codeplex.com/

http://webapiscaffolding.codeplex.com/

http://geekswithblogs.net/michelotti

More Related Content

Viewers also liked

Chỉ 307tr sở hữu ngay căn hộ tại trung tâm gò vấp
Chỉ 307tr sở hữu ngay căn hộ tại trung tâm gò vấpChỉ 307tr sở hữu ngay căn hộ tại trung tâm gò vấp
Chỉ 307tr sở hữu ngay căn hộ tại trung tâm gò vấpkimthoa3124
 
Nikko 1650
Nikko 1650Nikko 1650
Nikko 1650k0rb3n
 
CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 09815 45 75 39
CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 09815 45 75 39CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 09815 45 75 39
CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 09815 45 75 39kimthoa3124
 
Creating Discounts & Promotions with Hitachi Solutions Ecommerce
Creating Discounts & Promotions with Hitachi Solutions EcommerceCreating Discounts & Promotions with Hitachi Solutions Ecommerce
Creating Discounts & Promotions with Hitachi Solutions EcommerceHitachi Solutions America, Ltd.
 

Viewers also liked (6)

Chỉ 307tr sở hữu ngay căn hộ tại trung tâm gò vấp
Chỉ 307tr sở hữu ngay căn hộ tại trung tâm gò vấpChỉ 307tr sở hữu ngay căn hộ tại trung tâm gò vấp
Chỉ 307tr sở hữu ngay căn hộ tại trung tâm gò vấp
 
Nikko 1650
Nikko 1650Nikko 1650
Nikko 1650
 
CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 09815 45 75 39
CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 09815 45 75 39CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 09815 45 75 39
CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 09815 45 75 39
 
Emails in Hitachi Solutions Ecommerce
Emails in Hitachi Solutions EcommerceEmails in Hitachi Solutions Ecommerce
Emails in Hitachi Solutions Ecommerce
 
English
EnglishEnglish
English
 
Creating Discounts & Promotions with Hitachi Solutions Ecommerce
Creating Discounts & Promotions with Hitachi Solutions EcommerceCreating Discounts & Promotions with Hitachi Solutions Ecommerce
Creating Discounts & Promotions with Hitachi Solutions Ecommerce
 

Recently uploaded

Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024TopCSSGallery
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsUXDXConf
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfEasyPrinterHelp
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxEasyPrinterHelp
 

Recently uploaded (20)

Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdf
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptx
 

MVC Scaffolding Made Easy

Editor's Notes

  1. “…it doesn’t generate code that suits my project.”“…the code is not complete enough for Production use.”“…I have a non-MVC project
  2. First demo – default MvcScaffolding using diloguesDescribe filesAdd view WorkOrderAdd controler, new data contextDefault dB is SQL express – go lighter using SQL CEPM&gt; Install-Package EntityFramework.SqlServerCompactPM&gt; Install-Package MvcScaffoldingPM&gt; Scaffold Controller –ModelTypeWorkOrder –ControllernameWorkOrderController – DbContextTypeWorkOrderDbcontextMVC controllers best practiceencapsulate something in the interface leverage dependency injection (to make the controllers testable)Let’s add repository PM&gt; Scaffold Controller –ModelTypeWorkOrder –ControllernameWorkOrderController – DbContextTypeWorkOrder – RepositoryPM&gt; Scaffold Controller –ModelTypeWorkOrder –ControllernameWorkOrderController – DbContextTypeWorkOrder – Repository -Force
  3. Everything revolves arround command lineImportant to not only understand but also to know what’s availableSwitch = booleans – false by default, it’s pressence implies setting to true (basic Power Shell functionality)Options
  4. Get-ModuleGet-Command –Module T4ScaffoldingGet-Alias ScaffoldGet-Help Invoke –Scaffolder (abreviated list, just the basic command options, use TAB to see all the options)Scaffold [tab]Controller –[tab]Scaffold [tab]View –[tab]
  5. Customizing templates
  6. ScaffoldMvcScaffolding.ActionWithUnitTest –Controller WorkOrderController –Action ArchiveWorkOrder –ViewModelWorkOrderCustomizingScaffold CustomTemplateViewIndexShow the CodeTemlate folder with T4 fileFind ModelProperty and add “DisplayName”Add new method GetDisplayName()PM&gt; Scaffold Controller –ModelTypeWorkOrder –ControllernameWorkOrderController – DbContextTypeWorkOrder – Repository -Force
  7. Jay has shown you
  8. Jay has shown you