diff --git a/mvc/tutorials/mvc-with-entity-framework.rst b/mvc/tutorials/mvc-with-entity-framework.rst index 4623e288af..a0dc2b7704 100644 --- a/mvc/tutorials/mvc-with-entity-framework.rst +++ b/mvc/tutorials/mvc-with-entity-framework.rst @@ -1,13 +1,13 @@ Get Started with Entity Framework 7 Code using ASP.NET MVC 6 ============================================================ -By `Mike Wasson`_ +By `Mike Wasson`_ and `Rick Anderson`_ In this tutorial, you’ll create a simple web app using ASP.NET MVC and Entity Framework (EF). The app stores records in a SQL database and supports the basic CRUD operations (create, read, update, delete). .. note:: This tutorial uses Visual Studio 2015. If you are completely new to ASP.NET MVC or Visual Studio, read :doc:`../getting-started/first-mvc-app` first. -The sample app that you'll build manages a list of authors and books. Here is a screenshot of the app: +The sample app that you'll build manages a list of authors and books. Here is a screen shot of the app: .. image:: mvc-with-entity-framework/_static/screenshot1.png @@ -62,7 +62,7 @@ with this: :lines: 37-38 :dedent: 24 -This adds links to a Books page, which we haven’t created yet. (That will come later in tutorial.) +This adds a link to the Books page, which we haven’t created yet. (That will come later in tutorial.) Add Entity Framework -------------------- @@ -73,7 +73,7 @@ Open the *project.json* file. In the dependencies section, add the following lin "dependencies": { ... - "EntityFramework.SqlServer": "7.0.0-beta4" + "EntityFramework.SqlServer": "7.0.0-beta5" }, When you save *project.json*, Visual Studio automatically resolves the new package reference. @@ -92,7 +92,7 @@ We'll define a class for each. First, add a new folder to the project. In Soluti .. image:: mvc-with-entity-framework/_static/add-folder.png -.. note:: You can put model classes anywhere in your project. The "Models" folder is just a convention. +.. note:: You can put model classes anywhere in your project. The *Models* folder is just a convention. Right-click the *Models* folder and select **Add** > **New Item**. In the **Add New Item** dialog, select the **Class** template. In the **Name** edit box, type "Author.cs" and click OK. Replace the boilerplate code with: @@ -147,34 +147,36 @@ Add the following code at the end of the *Configure* method: .. literalinclude:: mvc-with-entity-framework/sample/src/ContosoBooks/Startup.cs :language: c# - :lines: 71 + :lines: 74 :dedent: 12 -Notice in *ConfigureServices* that we call ``Configuration.Get`` to get the database connection string. During development, this setting comes from config.json. When you deploy the app to a production environment, you would store the connection string in an environment variable on the host. If the Configuration API finds an environment variable with the same key, it returns the environment variable instead of the value that is in config.json. +Notice in *ConfigureServices* that we call ``Configuration.Get`` to get the database connection string. During development, this setting comes from the *config.json* file. When you deploy the app to a production environment, you set the connection string in an environment variable on the host. If the Configuration API finds an environment variable with the same key, it returns the environment variable instead of the value that is in *config.json*. Here is the complete *Startup.cs* after these changes: .. literalinclude:: mvc-with-entity-framework/sample/src/ContosoBooks/Startup.cs :language: c# - :emphasize-lines: 1,5,32-37,71 + :emphasize-lines: 1,5,32-37,74 Use data migrations to create the database ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Open *project.json*. In the "commands" section, add an entry for ``EntityFramework.Commands``: +Open *project.json*. +- In the "commands" and "dependencies" sections, add an entry for ``EntityFramework.Commands``. .. literalinclude:: mvc-with-entity-framework/sample/src/ContosoBooks/project.json :language: json - :lines: 21-25 - :dedent: 4 - :emphasize-lines: 4 + :emphasize-lines: 18,23 -Open a command prompt in the project directory (/ContosoBooks/src/ContosoBooks) and run the following commands: +Build the app. + +.. dnu restore removed + +Open a command prompt in the project directory (ContosoBooks/src/ContosoBooks) and run the following commands: .. code-block:: none - dnvm use default - dnu restore + dnvm use 1.0.0-beta5 dnx . ef migration add Initial dnx . ef migration apply @@ -182,7 +184,13 @@ The "``add Initial``" command adds code to the project that allows EF to update .. image:: mvc-with-entity-framework/_static/migrations.png -For more information about ``dnvm``, ``dnu``, and ``dnx``, see :ref:`DNX Overview `. +- **dnvm** : The .NET Version Manager, a set of command line utilities that are used to update and configure .NET Runtime. The command ``dnvm use 1.0.0-beta5`` instructs the .NET Version Manager to add the 1.0.0-beta5 ASP.NET 5 runtime to the ``PATH`` environment variable for the current shell. For ASP.NET 5 Beta 5, the following is displayed: + +.. code-block:: none + + Adding C:\\Users\\\\.dnx\\runtimes\\dnx-clr-win-x86.1.0.0-beta5\\bin to process PATH + +- **dnx . ef migration add Initial** : `DNX `_ is the .NET Execution Environment. The ``ef migration apply`` command runs pending migration code. For more information about ``dnvm``, ``dnu``, and ``dnx``, see :ref:`DNX Overview `. Add an index page ----------------- @@ -197,7 +205,7 @@ Replace the boilerplate code with the following: .. literalinclude:: mvc-with-entity-framework/sample/src/ContosoBooks/Controllers/BookController.cs :language: c# - :lines: 1-26,149-150 + :lines: 1-26,161-162 Notice that we don't set any value for ``Logger`` and ``BookContext``. The dependency injection (DI) subsystem automatically sets these properties at runtime. DI also handles the object lifetimes, so you don't need to call ``Dispose``. For more information, see :ref:`Dependency Injection `. @@ -227,7 +235,7 @@ Add the following method to the ``BooksController`` class: This code looks up a book by ID. In the EF query: - The ``Include`` method tells EF to fetch the related ``Author`` entity. -- The ``SingleOrDefault`` method returns a single entity, or ``null`` if none is found. +- The ``SingleOrDefaultAsync`` method returns a single entity, or ``null`` if one is not found. If the EF query returns ``null``, the controller method returns ``HttpNotFound``, which ASP.NET translates into a 404 response. Otherwise, the controller passes *book* to a view, which renders the details page. Let’s add the view now. diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/ContosoBooks.sln b/mvc/tutorials/mvc-with-entity-framework/sample/ContosoBooks.sln index 7a77f387e9..08959039a3 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/ContosoBooks.sln +++ b/mvc/tutorials/mvc-with-entity-framework/sample/ContosoBooks.sln @@ -1,16 +1,16 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.22823.1 +VisualStudioVersion = 14.0.23019.3 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{AD710406-FC30-4A6B-96BC-AD981A8861D7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{17564FAC-B6C3-4EB4-AF0B-FE8F00B527BA}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F778A387-EA47-489D-95B5-BC339F4801C7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9211E070-3BC1-4F10-9F21-7C5141550F42}" ProjectSection(SolutionItems) = preProject global.json = global.json EndProjectSection EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ContosoBooks", "src\ContosoBooks\ContosoBooks.xproj", "{573CDF65-E3B0-4BE5-AEEC-87A50C768B75}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ContosoBooks", "src\ContosoBooks\ContosoBooks.xproj", "{03F588A7-3C46-492C-8E44-5A45D6F34C46}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -18,15 +18,15 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {573CDF65-E3B0-4BE5-AEEC-87A50C768B75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {573CDF65-E3B0-4BE5-AEEC-87A50C768B75}.Debug|Any CPU.Build.0 = Debug|Any CPU - {573CDF65-E3B0-4BE5-AEEC-87A50C768B75}.Release|Any CPU.ActiveCfg = Release|Any CPU - {573CDF65-E3B0-4BE5-AEEC-87A50C768B75}.Release|Any CPU.Build.0 = Release|Any CPU + {03F588A7-3C46-492C-8E44-5A45D6F34C46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {03F588A7-3C46-492C-8E44-5A45D6F34C46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {03F588A7-3C46-492C-8E44-5A45D6F34C46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {03F588A7-3C46-492C-8E44-5A45D6F34C46}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {573CDF65-E3B0-4BE5-AEEC-87A50C768B75} = {AD710406-FC30-4A6B-96BC-AD981A8861D7} + {03F588A7-3C46-492C-8E44-5A45D6F34C46} = {17564FAC-B6C3-4EB4-AF0B-FE8F00B527BA} EndGlobalSection EndGlobal diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/global.json b/mvc/tutorials/mvc-with-entity-framework/sample/global.json index e4370fd001..f1ad6f5698 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/global.json +++ b/mvc/tutorials/mvc-with-entity-framework/sample/global.json @@ -1,6 +1,8 @@ { - "projects": [ "src", "test" ], - "sdk": { - "version": "1.0.0-beta4" - } + "projects": [ "src", "test" ], + "sdk": { + "version": "1.0.0-beta5", + "runtime": "clr", + "architecture": "x86" + } } diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/.bowerrc b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/.bowerrc new file mode 100644 index 0000000000..6406626abf --- /dev/null +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "wwwroot/lib" +} diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Compiler/Preprocess/RazorPreCompilation.cs b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Compiler/Preprocess/RazorPreCompilation.cs deleted file mode 100644 index 6e08691bb5..0000000000 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Compiler/Preprocess/RazorPreCompilation.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; - -namespace ContosoBooks.Compiler.Preprocess -{ - // Uncomment the following class to enable pre-compilation of Razor views. - // Pre-compilation may reduce the time it takes to build and launch your project. - // Please note, in this pre-release of Visual Studio 2015, enabling pre-compilation may cause IntelliSense and build errors in views using Tag Helpers. - - //public class RazorPreCompilation : RazorPreCompileModule - //{ - // public RazorPreCompilation(IServiceProvider provider) : base(provider) - // { - // GenerateSymbols = true; - // } - //} -} diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/ContosoBooks.xproj b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/ContosoBooks.xproj index 5d1eb8e162..d345b1421a 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/ContosoBooks.xproj +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/ContosoBooks.xproj @@ -6,14 +6,14 @@ - 573cdf65-e3b0-4be5-aeec-87a50c768b75 + 03f588a7-3c46-492c-8e44-5a45d6f34c46 ContosoBooks ..\..\artifacts\obj\$(MSBuildProjectName) ..\..\artifacts\bin\$(MSBuildProjectName)\ 2.0 - 18289 + 8816 \ No newline at end of file diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Controllers/BookController.cs b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Controllers/BookController.cs index 25bc7144e6..4258b53982 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Controllers/BookController.cs +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Controllers/BookController.cs @@ -21,8 +21,8 @@ namespace ContosoBooks.Controllers public IActionResult Index() { - var books = BookContext.Books.Include(b => b.Author); - return View(books); + var books = BookContext.Books.Include(b => b.Author); + return View(books); } public async Task Details(int id) @@ -40,7 +40,7 @@ namespace ContosoBooks.Controllers public ActionResult Create() { - ViewBag.Items = GetAuthorsListItems(); + ViewBag.Items = GetAuthorsListItems(); return View(); } @@ -146,5 +146,17 @@ namespace ContosoBooks.Controllers Selected = author.AuthorID == selected }); } + + private IEnumerable GetAuthorsListItems2246(int selected = -1) + { + return BookContext.Authors + .OrderBy(author => author.LastName) + .Select(author => new SelectListItem + { + Text = String.Format("{0}, {1}", author.LastName, author.FirstMidName), + Value = author.AuthorID.ToString(), + Selected = author.AuthorID == selected + }); + } } -} +} \ No newline at end of file diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Controllers/HomeController.cs b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Controllers/HomeController.cs index ca1fabbffb..9683e932a3 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Controllers/HomeController.cs +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Controllers/HomeController.cs @@ -1,4 +1,8 @@ -using Microsoft.AspNet.Mvc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNet.Mvc; namespace ContosoBooks.Controllers { @@ -11,14 +15,14 @@ namespace ContosoBooks.Controllers public IActionResult About() { - ViewBag.Message = "Your application description page."; + ViewData["Message"] = "Your application description page."; return View(); } public IActionResult Contact() { - ViewBag.Message = "Your contact page."; + ViewData["Message"] = "Your contact page."; return View(); } diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/20150521200520_initial.Designer.cs b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/20150521200520_initial.Designer.cs deleted file mode 100644 index e167fffde5..0000000000 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/20150521200520_initial.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Metadata.Builders; -using Microsoft.Data.Entity.Relational.Migrations.Infrastructure; -using ContosoBooks.Models; - -namespace ContosoBooks.Migrations -{ - [ContextType(typeof(BookContext))] - partial class initial - { - public override string Id - { - get { return "20150521200520_initial"; } - } - - public override string ProductVersion - { - get { return "7.0.0-beta4-12943"; } - } - - public override IModel Target - { - get - { - var builder = new BasicModelBuilder() - .Annotation("SqlServer:ValueGeneration", "Sequence"); - - builder.Entity("ContosoBooks.Models.Author", b => - { - b.Property("AuthorID") - .GenerateValueOnAdd() - .Annotation("OriginalValueIndex", 0) - .Annotation("SqlServer:ValueGeneration", "Default"); - b.Property("FirstMidName") - .Annotation("OriginalValueIndex", 1); - b.Property("LastName") - .Annotation("OriginalValueIndex", 2); - b.Key("AuthorID"); - }); - - builder.Entity("ContosoBooks.Models.Book", b => - { - b.Property("AuthorID") - .Annotation("OriginalValueIndex", 0); - b.Property("BookID") - .GenerateValueOnAdd() - .Annotation("OriginalValueIndex", 1) - .Annotation("SqlServer:ValueGeneration", "Default"); - b.Property("Genre") - .Annotation("OriginalValueIndex", 2); - b.Property("Price") - .Annotation("OriginalValueIndex", 3); - b.Property("Title") - .Annotation("OriginalValueIndex", 4); - b.Property("Year") - .Annotation("OriginalValueIndex", 5); - b.Key("BookID"); - }); - - builder.Entity("ContosoBooks.Models.Book", b => - { - b.ForeignKey("ContosoBooks.Models.Author", "AuthorID"); - }); - - return builder.Model; - } - } - } -} diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/20150624041210_Initial.Designer.cs b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/20150624041210_Initial.Designer.cs new file mode 100644 index 0000000000..3936b4b89b --- /dev/null +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/20150624041210_Initial.Designer.cs @@ -0,0 +1,69 @@ +using System; +using Microsoft.Data.Entity; +using Microsoft.Data.Entity.Metadata; +using Microsoft.Data.Entity.Relational.Migrations.Infrastructure; +using ContosoBooks.Models; + +namespace ContosoBooks.Migrations +{ + [ContextType(typeof(BookContext))] + partial class Initial + { + public override string Id + { + get { return "20150624041210_Initial"; } + } + + public override string ProductVersion + { + get { return "7.0.0-beta5-13518"; } + } + + public override void BuildTargetModel(ModelBuilder builder) + { + builder + .Annotation("SqlServer:DefaultSequenceName", "DefaultSequence") + .Annotation("SqlServer:Sequence:.DefaultSequence", "'DefaultSequence', '', '1', '10', '', '', 'Int64', 'False'") + .Annotation("SqlServer:ValueGeneration", "Sequence"); + + builder.Entity("ContosoBooks.Models.Author", b => + { + b.Property("AuthorID") + .GenerateValueOnAdd() + .StoreGeneratedPattern(StoreGeneratedPattern.Identity); + + b.Property("FirstMidName"); + + b.Property("LastName"); + + b.Key("AuthorID"); + }); + + builder.Entity("ContosoBooks.Models.Book", b => + { + b.Property("BookID") + .GenerateValueOnAdd() + .StoreGeneratedPattern(StoreGeneratedPattern.Identity); + + b.Property("AuthorID"); + + b.Property("Genre"); + + b.Property("Price"); + + b.Property("Title"); + + b.Property("Year"); + + b.Key("BookID"); + }); + + builder.Entity("ContosoBooks.Models.Book", b => + { + b.Reference("ContosoBooks.Models.Author") + .InverseCollection() + .ForeignKey("AuthorID"); + }); + } + } +} diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/20150521200520_initial.cs b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/20150624041210_Initial.cs similarity index 98% rename from mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/20150521200520_initial.cs rename to mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/20150624041210_Initial.cs index 54dc2f76f5..d04c33bb59 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/20150521200520_initial.cs +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/20150624041210_Initial.cs @@ -5,7 +5,7 @@ using Microsoft.Data.Entity.Relational.Migrations.Operations; namespace ContosoBooks.Migrations { - public partial class initial : Migration + public partial class Initial : Migration { public override void Up(MigrationBuilder migration) { @@ -30,8 +30,8 @@ namespace ContosoBooks.Migrations name: "Book", columns: table => new { - AuthorID = table.Column(type: "int", nullable: false), BookID = table.Column(type: "int", nullable: false), + AuthorID = table.Column(type: "int", nullable: false), Genre = table.Column(type: "nvarchar(max)", nullable: true), Price = table.Column(type: "decimal(18, 2)", nullable: false), Title = table.Column(type: "nvarchar(max)", nullable: true), diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/BookContextModelSnapshot.cs b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/BookContextModelSnapshot.cs index af73930ada..20fcb843ae 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/BookContextModelSnapshot.cs +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Migrations/BookContextModelSnapshot.cs @@ -1,7 +1,6 @@ using System; using Microsoft.Data.Entity; using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Metadata.Builders; using Microsoft.Data.Entity.Relational.Migrations.Infrastructure; using ContosoBooks.Models; @@ -10,52 +9,51 @@ namespace ContosoBooks.Migrations [ContextType(typeof(BookContext))] partial class BookContextModelSnapshot : ModelSnapshot { - public override IModel Model + public override void BuildModel(ModelBuilder builder) { - get - { - var builder = new BasicModelBuilder() - .Annotation("SqlServer:ValueGeneration", "Sequence"); - - builder.Entity("ContosoBooks.Models.Author", b => - { - b.Property("AuthorID") - .GenerateValueOnAdd() - .Annotation("OriginalValueIndex", 0) - .Annotation("SqlServer:ValueGeneration", "Default"); - b.Property("FirstMidName") - .Annotation("OriginalValueIndex", 1); - b.Property("LastName") - .Annotation("OriginalValueIndex", 2); - b.Key("AuthorID"); - }); - - builder.Entity("ContosoBooks.Models.Book", b => - { - b.Property("AuthorID") - .Annotation("OriginalValueIndex", 0); - b.Property("BookID") - .GenerateValueOnAdd() - .Annotation("OriginalValueIndex", 1) - .Annotation("SqlServer:ValueGeneration", "Default"); - b.Property("Genre") - .Annotation("OriginalValueIndex", 2); - b.Property("Price") - .Annotation("OriginalValueIndex", 3); - b.Property("Title") - .Annotation("OriginalValueIndex", 4); - b.Property("Year") - .Annotation("OriginalValueIndex", 5); - b.Key("BookID"); - }); - - builder.Entity("ContosoBooks.Models.Book", b => - { - b.ForeignKey("ContosoBooks.Models.Author", "AuthorID"); - }); - - return builder.Model; - } + builder + .Annotation("SqlServer:DefaultSequenceName", "DefaultSequence") + .Annotation("SqlServer:Sequence:.DefaultSequence", "'DefaultSequence', '', '1', '10', '', '', 'Int64', 'False'") + .Annotation("SqlServer:ValueGeneration", "Sequence"); + + builder.Entity("ContosoBooks.Models.Author", b => + { + b.Property("AuthorID") + .GenerateValueOnAdd() + .StoreGeneratedPattern(StoreGeneratedPattern.Identity); + + b.Property("FirstMidName"); + + b.Property("LastName"); + + b.Key("AuthorID"); + }); + + builder.Entity("ContosoBooks.Models.Book", b => + { + b.Property("BookID") + .GenerateValueOnAdd() + .StoreGeneratedPattern(StoreGeneratedPattern.Identity); + + b.Property("AuthorID"); + + b.Property("Genre"); + + b.Property("Price"); + + b.Property("Title"); + + b.Property("Year"); + + b.Key("BookID"); + }); + + builder.Entity("ContosoBooks.Models.Book", b => + { + b.Reference("ContosoBooks.Models.Author") + .InverseCollection() + .ForeignKey("AuthorID"); + }); } } } diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Models/BookContext.cs b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Models/BookContext.cs index 148c99f926..aa39630f16 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Models/BookContext.cs +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Models/BookContext.cs @@ -7,4 +7,4 @@ namespace ContosoBooks.Models public DbSet Authors { get; set; } public DbSet Books { get; set; } } -} +} \ No newline at end of file diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Models/SampleData.cs b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Models/SampleData.cs index 3f1bbf04fe..7e102cfe95 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Models/SampleData.cs +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Models/SampleData.cs @@ -22,22 +22,42 @@ namespace ContosoBooks.Models new Author { LastName = "Cervantes", FirstMidName = "Miguel" }).Entity; context.Books.AddRange( - new Book() { - Title = "Pride and Prejudice", Year = 1813, Author = austen, - Price = 9.99M, Genre = "Comedy of manners" }, - new Book() { - Title = "Northanger Abbey", Year = 1817, Author = austen, - Price = 12.95M, Genre = "Gothic parody" }, - new Book() { - Title = "David Copperfield", Year = 1850, Author = dickens, - Price = 15, Genre = "Bildungsroman" }, - new Book() { - Title = "Don Quixote", Year = 1617, Author = cervantes, - Price = 8.95M, Genre = "Picaresque" } + new Book() + { + Title = "Pride and Prejudice", + Year = 1813, + Author = austen, + Price = 9.99M, + Genre = "Comedy of manners" + }, + new Book() + { + Title = "Northanger Abbey", + Year = 1817, + Author = austen, + Price = 12.95M, + Genre = "Gothic parody" + }, + new Book() + { + Title = "David Copperfield", + Year = 1850, + Author = dickens, + Price = 15, + Genre = "Bildungsroman" + }, + new Book() + { + Title = "Don Quixote", + Year = 1617, + Author = cervantes, + Price = 8.95M, + Genre = "Picaresque" + } ); context.SaveChanges(); } } } } -} +} \ No newline at end of file diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Project_Readme.html b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Project_Readme.html new file mode 100644 index 0000000000..bc23184530 --- /dev/null +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Project_Readme.html @@ -0,0 +1,203 @@ + + + + + Welcome to ASP.NET 5 + + + + + + + + + + diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Properties/AppSettings.cs b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Properties/AppSettings.cs deleted file mode 100644 index be4c006971..0000000000 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Properties/AppSettings.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace ContosoBooks -{ - public class AppSettings - { - public string SiteTitle { get; set; } - } -} diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Startup.cs b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Startup.cs index b0df9c5d6a..f71fc042c4 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Startup.cs +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Startup.cs @@ -3,20 +3,22 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.Diagnostics; using Microsoft.AspNet.Hosting; using Microsoft.Data.Entity; -using Microsoft.Framework.ConfigurationModel; +using Microsoft.Framework.Configuration; using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.Logging; +using Microsoft.Framework.Runtime; namespace ContosoBooks { public class Startup { - public Startup(IHostingEnvironment env) + public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv) { // Setup configuration sources. - Configuration = new Configuration() + var builder = new ConfigurationBuilder(appEnv.ApplicationBasePath) .AddJsonFile("config.json") .AddEnvironmentVariables(); + Configuration = builder.Build(); } public IConfiguration Configuration { get; set; } @@ -24,8 +26,6 @@ namespace ContosoBooks // This method gets called by the runtime. public void ConfigureServices(IServiceCollection services) { - services.Configure(Configuration.GetSubKey("AppSettings")); - // Add MVC services to the services container. services.AddMvc(); @@ -38,15 +38,15 @@ namespace ContosoBooks } // Configure is called after ConfigureServices is called. - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerfactory) + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { + loggerFactory.MinimumLevel = LogLevel.Information; + loggerFactory.AddConsole(); + // Configure the HTTP request pipeline. - // Add the console logger. - loggerfactory.AddConsole(minLevel: LogLevel.Verbose); - // Add the following to the request pipeline only in development environment. - if (env.IsEnvironment("Development")) + if (env.IsDevelopment()) { app.UseBrowserLink(); app.UseErrorPage(ErrorPageOptions.ShowAll); @@ -66,7 +66,10 @@ namespace ContosoBooks { routes.MapRoute( name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); + template: "{controller=Book}/{action=Index}/{id?}"); + + // Uncomment the following line to add a route for porting Web API 2 controllers. + // routes.MapWebApiRoute("DefaultApi", "api/{controller}/{id?}"); }); SampleData.Initialize(app.ApplicationServices); } diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Book/Index.cshtml b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Book/Index.cshtml index bc52536b3c..adf66a010d 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Book/Index.cshtml +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Book/Index.cshtml @@ -1,6 +1,6 @@ @model IEnumerable @{ - ViewBag.Title = "Books"; + ViewBag.Title = "Books"; }

Create New Book @@ -32,5 +32,4 @@ } - - + \ No newline at end of file diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Home/About.cshtml b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Home/About.cshtml index 4b2d9e8440..9b9f0c498b 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Home/About.cshtml +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Home/About.cshtml @@ -1,7 +1,9 @@ @{ - ViewBag.Title = "About"; + ViewData["Title"] = "About"; } -

@ViewBag.Title.

-

@ViewBag.Message

+

@ViewData["Title"].

+

@ViewData["Message"]

+ +Test

Use this area to provide additional information.

diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Home/Contact.cshtml b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Home/Contact.cshtml index 01436993cf..15c12c6d12 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Home/Contact.cshtml +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Home/Contact.cshtml @@ -1,8 +1,8 @@ @{ - ViewBag.Title = "Contact"; + ViewData["Title"] = "Contact"; } -

@ViewBag.Title.

-

@ViewBag.Message

+

@ViewData["Title"].

+

@ViewData["Message"]

One Microsoft Way
@@ -12,6 +12,6 @@
- Support: Support@example.com
+ Support: Support@example.com
Marketing: Marketing@example.com
diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Home/Index.cshtml b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Home/Index.cshtml index 84847d7769..c03bc6f0cf 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Home/Index.cshtml +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Home/Index.cshtml @@ -1,5 +1,5 @@ @{ - ViewBag.Title = "Home Page"; + ViewData["Title"] = "Home Page"; }
-
-

This application consists of:

+
+

Application uses

    -
  • Sample pages showing basic nav
  • +
  • Sample pages using ASP.NET 5 (MVC 6)
  • +
  • Gulp and Bower for managing client-side resources
  • Theming using Bootstrap
-
+ + - diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Shared/Error.cshtml b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Shared/Error.cshtml index 26ebcf0110..4852442680 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Shared/Error.cshtml +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Shared/Error.cshtml @@ -1,5 +1,5 @@ @{ - ViewBag.Title = "Error"; + ViewData["Title"] = "Error"; }

Error.

diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Shared/_Layout.cshtml b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Shared/_Layout.cshtml index 95f472661c..eb44d9427c 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Shared/_Layout.cshtml +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/Shared/_Layout.cshtml @@ -1,14 +1,13 @@ -@inject IOptions AppSettings - + - @ViewBag.Title - @AppSettings.Options.SiteTitle + @ViewData["Title"] - ContosoBooks - - + + @@ -18,7 +17,7 @@ - + @@ -30,13 +29,14 @@ - @AppSettings.Options.SiteTitle + ContosoBooks
@@ -45,33 +45,34 @@ @RenderBody()
-

© 2015 - @AppSettings.Options.SiteTitle

+

© 2015 - ContosoBooks

- - + + - + - + @RenderSection("scripts", required: false) diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/_GlobalImport.cshtml b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/_ViewImports.cshtml similarity index 64% rename from mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/_GlobalImport.cshtml rename to mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/_ViewImports.cshtml index 27d56c5c77..9da09fefa2 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/_GlobalImport.cshtml +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/Views/_ViewImports.cshtml @@ -1,3 +1,2 @@ @using ContosoBooks -@using Microsoft.Framework.OptionsModel @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers" diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/bower.json b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/bower.json index 599b015f96..51002ed97b 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/bower.json +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/bower.json @@ -3,10 +3,10 @@ "private": true, "dependencies": { "bootstrap": "3.0.0", - "jquery": "1.10.2", - "jquery-validation": "1.11.1", - "jquery-validation-unobtrusive": "3.2.2", + "bootstrap-touch-carousel": "0.8.0", "hammer.js": "2.0.4", - "bootstrap-touch-carousel": "0.8.0" + "jquery": "2.1.4", + "jquery-validation": "1.11.1", + "jquery-validation-unobtrusive": "3.2.2" } } diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/config.json b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/config.json index fc2d1d1920..18bf2120c3 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/config.json +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/config.json @@ -5,4 +5,4 @@ "Data": { "ConnectionString": "Server=(localdb)\\MSSQLLocalDB;Database=ContosoBooks;Trusted_Connection=True;MultipleActiveResultSets=true" } -} +} \ No newline at end of file diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/gulpfile.js b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/gulpfile.js index 4c1e6c7bc9..684c5ac2cf 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/gulpfile.js +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/gulpfile.js @@ -1,32 +1,45 @@ /// var gulp = require("gulp"), - rimraf = require("rimraf"), - fs = require("fs"); - -eval("var project = " + fs.readFileSync("./project.json")); + rimraf = require("rimraf"), + concat = require("gulp-concat"), + cssmin = require("gulp-cssmin"), + uglify = require("gulp-uglify"), + project = require("./project.json"); var paths = { - bower: "./bower_components/", - lib: "./" + project.webroot + "/lib/" + webroot: "./" + project.webroot + "/" }; -gulp.task("clean", function (cb) { - rimraf(paths.lib, cb); +paths.js = paths.webroot + "js/**/*.js"; +paths.minJs = paths.webroot + "js/**/*.min.js"; +paths.css = paths.webroot + "css/**/*.css"; +paths.minCss = paths.webroot + "css/**/*.min.css"; +paths.concatJsDest = paths.webroot + "js/site.min.js"; +paths.concatCssDest = paths.webroot + "css/site.min.css"; + +gulp.task("clean:js", function (cb) { + rimraf(paths.concatJsDest, cb); }); -gulp.task("copy", ["clean"], function () { - var bower = { - "bootstrap": "bootstrap/dist/**/*.{js,map,css,ttf,svg,woff,eot}", - "bootstrap-touch-carousel": "bootstrap-touch-carousel/dist/**/*.{js,css}", - "hammer.js": "hammer.js/hammer*.{js,map}", - "jquery": "jquery/jquery*.{js,map}", - "jquery-validation": "jquery-validation/jquery.validate.js", - "jquery-validation-unobtrusive": "jquery-validation-unobtrusive/jquery.validate.unobtrusive.js" - } - - for (var destinationDir in bower) { - gulp.src(paths.bower + bower[destinationDir]) - .pipe(gulp.dest(paths.lib + destinationDir)); - } +gulp.task("clean:css", function (cb) { + rimraf(paths.concatCssDest, cb); }); + +gulp.task("clean", ["clean:js", "clean:css"]); + +gulp.task("min:js", function () { + gulp.src([paths.js, "!" + paths.minJs], { base: "." }) + .pipe(concat(paths.concatJsDest)) + .pipe(uglify()) + .pipe(gulp.dest(".")); +}); + +gulp.task("min:css", function () { + gulp.src([paths.css, "!" + paths.minCss]) + .pipe(concat(paths.concatCssDest)) + .pipe(cssmin()) + .pipe(gulp.dest(".")); +}); + +gulp.task("min", ["min:js", "min:css"]); diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/hosting.ini b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/hosting.ini new file mode 100644 index 0000000000..126132d474 --- /dev/null +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/hosting.ini @@ -0,0 +1,2 @@ +server=Microsoft.AspNet.Server.WebListener +server.urls=http://localhost:5000 diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/package.json b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/package.json index 838ba76198..d4d71a996e 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/package.json +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/package.json @@ -3,6 +3,9 @@ "version": "0.0.0", "devDependencies": { "gulp": "3.8.11", + "gulp-concat": "2.5.2", + "gulp-cssmin": "0.1.7", + "gulp-uglify": "1.2.0", "rimraf": "2.2.8" } } diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/project.json b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/project.json index ce683d455a..44c1bd9306 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/project.json +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/project.json @@ -3,26 +3,25 @@ "version": "1.0.0-*", "dependencies": { - "Microsoft.AspNet.Diagnostics": "1.0.0-beta4", - "Microsoft.AspNet.Mvc": "6.0.0-beta4" , - "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta4", - "Microsoft.AspNet.Server.IIS": "1.0.0-beta4", - "Microsoft.AspNet.Server.WebListener": "1.0.0-beta4", - "Microsoft.AspNet.StaticFiles": "1.0.0-beta4", - "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta4", - "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4", - "Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta4", - "Microsoft.Framework.Logging": "1.0.0-beta4", - "Microsoft.Framework.Logging.Console": "1.0.0-beta4", - "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta4", - "EntityFramework.SqlServer": "7.0.0-beta4" + "Microsoft.AspNet.Diagnostics": "1.0.0-beta5", + "Microsoft.AspNet.Mvc": "6.0.0-beta5", + "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta5", + "Microsoft.AspNet.Server.IIS": "1.0.0-beta5", + "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5", + "Microsoft.AspNet.StaticFiles": "1.0.0-beta5", + "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta5", + "Microsoft.Framework.Configuration.Json": "1.0.0-beta5", + "Microsoft.Framework.Logging": "1.0.0-beta5", + "Microsoft.Framework.Logging.Console": "1.0.0-beta5", + "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta5", + "EntityFramework.SqlServer": "7.0.0-beta5", + "EntityFramework.Commands": "7.0.0-beta5" }, "commands": { - "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000", - "gen": "Microsoft.Framework.CodeGeneration", + "web": "Microsoft.AspNet.Hosting --config hosting.ini", "ef": "EntityFramework.Commands" - }, + }, "frameworks": { "dnx451": { }, @@ -42,7 +41,6 @@ "**.vspscc" ], "scripts": { - "postrestore": [ "npm install", "bower install" ], - "prepare": [ "gulp copy" ] + "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ] } } diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/wwwroot/_references.js b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/wwwroot/_references.js index 4e6ad34f16..ad7d373bb5 100644 --- a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/wwwroot/_references.js +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/wwwroot/_references.js @@ -1,9 +1,3 @@ /// /// -/// -/// -/// -/// -/// -/// -/// +/// diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/wwwroot/images/ASP-NET-Banners-02.png b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/wwwroot/images/ASP-NET-Banners-02.png index 2f456c0bb8..16c37fc55f 100644 Binary files a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/wwwroot/images/ASP-NET-Banners-02.png and b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/wwwroot/images/ASP-NET-Banners-02.png differ diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/wwwroot/js/site.js b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/wwwroot/js/site.js new file mode 100644 index 0000000000..82ecce7b4a --- /dev/null +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/wwwroot/js/site.js @@ -0,0 +1 @@ +// Write your Javascript code. diff --git a/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/wwwroot/web.config b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/wwwroot/web.config new file mode 100644 index 0000000000..8e3f2a69d7 --- /dev/null +++ b/mvc/tutorials/mvc-with-entity-framework/sample/src/ContosoBooks/wwwroot/web.config @@ -0,0 +1,11 @@ + + + + + + + + + + +