Jonathan Peterson Paladin Cloudware FILE -> NEW PROJECT E:...

Preview:

Citation preview

Jonathan PetersonPaladin Cloudware

FILE -> NEW PROJECT

E: jonathan@paladincloudware.comG+: +JonathanPeterson42GitHub & StackOverflow: Eonasdan

DEFAULT VS MVC PROJECT• Extra Packages like Modernizr

• Messy Code

• Hour + of preparation to get a project ready

HOW WE’RE GOING TO FIX IT• Using PowerShell to get things going

• Less

• Web.config

• Code templates

• Data annotations

• EditorFor Templates

• Bundles

USING POWERSHELL TO GET THINGS SETUP• PowerShell can be used to automate our first task

• Uninstall packages I don’t want

• Install packages I always install

• Update all the packages that are installed

USING LESS• Less gives us Mixins

• Parameters and variables

• Separate files

WEB.CONFIG ADDITIONS• View/web.config

• Web.config and web.release.config

INTERMISSION: PAPERCUT

http://papercut.codeplex.com

CODE TEMPLATES• Allows you to customize the OTB Views and Controllers

• No more unnecessary comments

• No more Resharper squigglies

C:\Program Files (x86)\Microsoft Visual Studio 12.0\ Common7\IDE\Extensions\Microsoft\Web\Mvc\Scaffolding\Templates

DATA ANNOTATIONS• Uses for validation (Required, Range, String Length)

• Specify field types (Phone, Email)

• DisplayFor and ValidationFor text

EDITORFOR TEMPLATES• Must be in Views > Shared > EditorTemplates

• Can be customized for each DataType

STRONGLY TYPED BUNDLES• Takes away the guesswork

• Easier to make changes to the bundle’s route

LINKS• Github: http://goo.gl/UhMAFd

• Code Templates:–C:\Program Files (x86)\Microsoft Visual Studio 12.0\ Common7\IDE\Extensions\Microsoft\Web\Mvc\Scaffolding\Templates

• Less: http://lesscss.org/

• Papercut (SMTP Server): http://papercut.codeplex.com