Search

Categories

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Send mail to the author(s) E-mail

# Friday, 05 February 2016
( VS2012 | VS2015 )

Change the solution file from

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1

to:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012

| | # 
# Monday, 02 December 2013
( VS2012 )

http://www.asp.net/visual-studio/overview/2012/aspnet-and-web-tools-20131-for-visual-studio-2012

Looks like it is install VS2012 Express.

  • MVC5
  • Bootstrap (CSS to style – responsive mobile first)
  • ASP.NET Web API 2
  • EF6 (and async actions)
  • ASP.NET Scaffolding

http://blogs.msdn.com/b/webdev/archive/2013/11/18/announcing-release-of-asp-net-and-web-tools-2013-1-for-visual-studio-2012.aspx

Scaffolding didn’t work first time

VS2013

Pluralsight:   Building Apps with ASP.NET MVC4 (5 is just about new features).  Also MVC4 Fundamentals which has Async and WebAPI

EF – What First?

  • Database
    • Point to a db, then it T4’s up .tt
  • Model
    • Similar.. use designer to gen SQL Scripts
  • Code First
    • Write classes.. just C#

Always using DbContext API.

Create new Blank Solution – Books

MVC5 Project – Books.Web

Empty – Books.Entities

image
Creating the CodeFirst Entities

public class Book
{
    public int Id { get; set; }

    [Required]
    [StringLength(255)]
    public string Title { get; set; }

    public Genre Category { get; set; }
}

Then the Enum:

public enum Genre
{
    NonFiction,
    Romance,
    Action,
    ScienceFiction
}

Then the BooksDb context: (in web.DataContexts)

public class BooksDb : DbContext
{
    public DbSet<Book> Books { get; set; }
}
| | # 
# Tuesday, 02 April 2013
( VS2012 | XAML )

Right click on any xaml file in solution explorer

  • Open with
  • Source Code (Text) Editor
  • Set as default

Much faster to load, but not to change between files.

Shift+F7 to View Designer to check.

| | # 
# Monday, 25 March 2013
( VS2012 )

http://visualstudiogallery.msdn.microsoft.com/a83505c6-77b3-44a6-b53b-73d77cba84c8

then: http://vscommands.squaredinfinity.com/features

  • Compare files
  • Highlights output in different colours in output window
  • Hide top menu
  • Make top menu Sentence Case
| | # 
# Tuesday, 19 February 2013
( VS2012 )

image

Ctrl +Alt+B – breakpoint window

| | # 
# Friday, 11 January 2013
# Friday, 16 November 2012
( VS2012 )

Ctrl + R, Ctrl + T  - Debug in current context

Ctrl + R, A  - Run all tests

Alt S W Enter… Test Explorer window

| | # 
# Tuesday, 13 November 2012
( VS2012 )

http://visualstudiogallery.msdn.microsoft.com/3a96a4dc-ba9c-4589-92c5-640e07332afd for VS2012

  • Map mode is good
  • Coloured tabs
  • Middle click scrolling
  • Alt + up arrow  move line up or down
| | # 
# Monday, 12 November 2012
( mstest | Testing | VS2012 )

Ctrl R T – Run tests in Debug in Current Context

use Debug.WriteLine

Then look in the debug output window

| | # 
# Friday, 05 October 2012
( SQLServer | VS2012 )

image
Installing this to get DB Functionality in VS2012

| | # 
# Tuesday, 02 October 2012
( VS2012 )

Ctrl + ;  - Search Solution explorer

ALT + E I O A  - Remove and sort unused usings

http://visualstudiogallery.msdn.microsoft.com/76293c4d-8c16-4f4a-aee6-21f83a571496  - CodeMaid

http://visualstudiogallery.msdn.microsoft.com/6ab922d0-21c0-4f06-ab5f-4ecd1fe7175d – NUnit plugin

Ctrl + R A  - Run all tests (in VS test runner)

Ctrk + R, Ctrl + T – Debug all tests in Context

Alt S W – View Test Explorer

Ctrl W E – View Error List

| | #