diff --git a/.gitignore b/.gitignore index c23e227ab9..3c1fe41c91 100644 --- a/.gitignore +++ b/.gitignore @@ -195,4 +195,5 @@ FakesAssemblies/ *.plg # Visual Studio 6 workspace options file -*.opt \ No newline at end of file +*.opt +samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/wwwroot/lib/ diff --git a/samples/MigratingFromMvc5/NewMvc6Project/NewMvc6Project.sln b/samples/MigratingFromMvc5/NewMvc6Project/NewMvc6Project.sln new file mode 100644 index 0000000000..e35124b324 --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/NewMvc6Project.sln @@ -0,0 +1,32 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.22609.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E0D7C65F-A53B-4ADE-BC48-07FCFAE5F40F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9CB1D392-4083-47D0-96B4-2F29D3CA02F6}" + ProjectSection(SolutionItems) = preProject + global.json = global.json + EndProjectSection +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NewMvc6Project", "src\NewMvc6Project\NewMvc6Project.kproj", "{FF6605B6-3B46-4E1D-859C-626BEC8AAC0D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FF6605B6-3B46-4E1D-859C-626BEC8AAC0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FF6605B6-3B46-4E1D-859C-626BEC8AAC0D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FF6605B6-3B46-4E1D-859C-626BEC8AAC0D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FF6605B6-3B46-4E1D-859C-626BEC8AAC0D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {FF6605B6-3B46-4E1D-859C-626BEC8AAC0D} = {E0D7C65F-A53B-4ADE-BC48-07FCFAE5F40F} + EndGlobalSection +EndGlobal diff --git a/samples/MigratingFromMvc5/NewMvc6Project/global.json b/samples/MigratingFromMvc5/NewMvc6Project/global.json new file mode 100644 index 0000000000..d6a8b85822 --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/global.json @@ -0,0 +1,6 @@ +{ + "sources": [ "src", "test" ], + "sdk": { + "version": "1.0.0-beta3" + } +} diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Config.json b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Config.json new file mode 100644 index 0000000000..cf78aa31df --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Config.json @@ -0,0 +1,7 @@ +{ + "Data": { + "DefaultConnection": { + "ConnectionString": "Server=(localdb)\\MSSQLLocalDB;Database=NewMvc6Project;Trusted_Connection=True;" + } + } +} \ No newline at end of file diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Controllers/HomeController.cs b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Controllers/HomeController.cs new file mode 100644 index 0000000000..3c96705d59 --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Controllers/HomeController.cs @@ -0,0 +1,29 @@ +using Microsoft.AspNet.Mvc; + +// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 + +namespace NewMvc6Project.Controllers +{ + public class HomeController : Controller + { + // GET: // + public IActionResult Index() + { + return View(); + } + + public IActionResult About() + { + ViewBag.Message = "Your application description page."; + + return View(); + } + + public IActionResult Contact() + { + ViewBag.Message = "Your contact page."; + + return View(); + } + } +} diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/NewMvc6Project.kproj b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/NewMvc6Project.kproj new file mode 100644 index 0000000000..195dea4f00 --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/NewMvc6Project.kproj @@ -0,0 +1,19 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + ff6605b6-3b46-4e1d-859c-626bec8aac0d + NewMvc6Project + ..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\artifacts\bin\$(MSBuildProjectName)\ + + + 2.0 + 2993 + + + \ No newline at end of file diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Project_Readme.html b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Project_Readme.html new file mode 100644 index 0000000000..b693be4eba --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Project_Readme.html @@ -0,0 +1,204 @@ + + + + + Welcome to ASP.NET 5 + + + + + + +
+
+

This application consists of:

+
    +
  • Sample pages using ASP.NET MVC 6
  • +
  • Grunt and Bower for managing client-side resources
  • +
  • Theming using Bootstrap
  • +
+
+ + + + + + + + +
+ + + \ No newline at end of file diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Startup.cs b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Startup.cs new file mode 100644 index 0000000000..3ce9b831c7 --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Startup.cs @@ -0,0 +1,39 @@ +using System; +using Microsoft.AspNet.Builder; +using Microsoft.AspNet.Http; +using Microsoft.Framework.DependencyInjection; +using Microsoft.Framework.ConfigurationModel; +using Microsoft.AspNet.Hosting; + +namespace NewMvc6Project +{ + public class Startup + { + public IConfiguration Configuration { get; set; } + + public Startup(IHostingEnvironment env) + { + // Setup configuration sources. + Configuration = new Configuration() + .AddJsonFile("config.json") + .AddEnvironmentVariables(); + } + + // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940 + public void ConfigureServices(IServiceCollection services) + { + services.AddMvc(); + } + + public void Configure(IApplicationBuilder app) + { + app.UseMvc(routes => + { + routes.MapRoute( + name: "default", + template: "{controller}/{action}/{id?}", + defaults: new { controller = "Home", action = "Index" }); + }); + } + } +} diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/Home/About.cshtml b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/Home/About.cshtml new file mode 100644 index 0000000000..52c29f5a56 --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/Home/About.cshtml @@ -0,0 +1,7 @@ +@{ + ViewBag.Title = "About"; +} +

@ViewBag.Title.

+

@ViewBag.Message

+ +

Use this area to provide additional information.

\ No newline at end of file diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/Home/Contact.cshtml b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/Home/Contact.cshtml new file mode 100644 index 0000000000..0f4327e7f1 --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/Home/Contact.cshtml @@ -0,0 +1,17 @@ +@{ + ViewBag.Title = "Contact"; +} +

@ViewBag.Title.

+

@ViewBag.Message

+ +
+ One Microsoft Way
+ Redmond, WA 98052-6399
+ P: + 425.555.0100 +
+ +
+ Support: Support@example.com
+ Marketing: Marketing@example.com +
\ No newline at end of file diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/Home/Index.cshtml b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/Home/Index.cshtml new file mode 100644 index 0000000000..c939b7e2ba --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/Home/Index.cshtml @@ -0,0 +1,31 @@ +@{ + ViewBag.Title = "Home Page"; +} + +
+

ASP.NET

+

ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.

+

Learn more »

+
+ +
+
+

Getting started

+

+ ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that + enables a clean separation of concerns and gives you full control over markup + for enjoyable, agile development. +

+

Learn more »

+
+
+

Get more libraries

+

NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.

+

Learn more »

+
+
+

Web Hosting

+

You can easily find a web hosting company that offers the right mix of features and price for your applications.

+

Learn more »

+
+
\ No newline at end of file diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/Shared/_Layout.cshtml b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000000..55260fa05a --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/Shared/_Layout.cshtml @@ -0,0 +1,44 @@ + + + + + + @ViewBag.Title - My ASP.NET Application + + + + + +
+ @RenderBody() +
+
+

© @DateTime.Now.Year - My ASP.NET Application

+
+
+ + @* + *@ + + @RenderSection("scripts", required: false) + + diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/_ViewStart.cshtml b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/_ViewStart.cshtml new file mode 100644 index 0000000000..2de62418c0 --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/bower.json b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/bower.json new file mode 100644 index 0000000000..a0c3a8c9f6 --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/bower.json @@ -0,0 +1,27 @@ +{ + "name": "NewMvc6Project", + "private": true, + "dependencies": { + "bootstrap": "3.0.0", + "jquery": "1.10.2", + "jquery-validation": "1.11.1", + "jquery-validation-unobtrusive": "3.2.2" + }, + "exportsOverride": { + "bootstrap": { + "js": "dist/js/*.*", + "css": "dist/css/*.*", + "fonts": "dist/fonts/*.*" + }, + + "jquery": { + "": "jquery.{js,min.js,min.map}" + }, + "jquery-validation": { + "": "jquery.validate.js" + }, + "jquery-validation-unobtrusive": { + "": "jquery.validate.unobtrusive.{js,min.js}" + } + } +} diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/gruntfile.js b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/gruntfile.js new file mode 100644 index 0000000000..4a09b2f1bc --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/gruntfile.js @@ -0,0 +1,30 @@ +/* +This file in the main entry point for defining grunt tasks and using grunt plugins. +Click here to learn more. http://go.microsoft.com/fwlink/?LinkID=513275&clcid=0x409 +*/ +module.exports = function (grunt) { + grunt.initConfig({ + bower: { + install: { + options: { + targetDir: "wwwroot/lib", + layout: "byComponent", + cleanTargetDir: false + } + } + }, + concat: { + all: { + src: ['wwwroot/lib/jquery/jquery.min.js', + 'wwwroot/lib/bootstrap/js/bootstrap.min.js' + ], + dest: 'wwwroot/lib/bundle.js' + } + } + }); + + grunt.registerTask("default", ["bower:install"]); + + grunt.loadNpmTasks("grunt-bower-task"); + grunt.loadNpmTasks('grunt-contrib-concat'); +}; \ No newline at end of file diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/package.json b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/package.json new file mode 100644 index 0000000000..0e747d271d --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/package.json @@ -0,0 +1,10 @@ +{ + "version": "1.0.0", + "name": "NewMvc6Project", + "private": true, + "devDependencies": { + "grunt": "0.4.5", + "grunt-bower-task": "0.4.0", + "grunt-contrib-concat": "0.5.1" + } +} \ No newline at end of file diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/project.json b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/project.json new file mode 100644 index 0000000000..97a221570f --- /dev/null +++ b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/project.json @@ -0,0 +1,25 @@ +{ + "webroot": "wwwroot", + "version": "1.0.0-*", + "dependencies": { + "Microsoft.AspNet.Server.IIS": "1.0.0-beta3", + "Microsoft.AspNet.Mvc": "6.0.0-beta3", + "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta3" + }, + "frameworks": { + "aspnet50": { }, + "aspnetcore50": { } + }, + "bundleExclude": [ + "node_modules", + "bower_components", + "**.kproj", + "**.user", + "**.vspscc" + ], + "exclude": [ + "wwwroot", + "node_modules", + "bower_components" + ] +} diff --git a/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/wwwroot/favicon.ico b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/wwwroot/favicon.ico new file mode 100644 index 0000000000..a3a799985c Binary files /dev/null and b/samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/wwwroot/favicon.ico differ