forked from dotnet/AspNetDocs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
532 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
samples/MigratingFromMvc5/NewMvc6Project/NewMvc6Project.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"sources": [ "src", "test" ], | ||
"sdk": { | ||
"version": "1.0.0-beta3" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"Data": { | ||
"DefaultConnection": { | ||
"ConnectionString": "Server=(localdb)\\MSSQLLocalDB;Database=NewMvc6Project;Trusted_Connection=True;" | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Controllers/HomeController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: /<controller>/ | ||
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(); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/NewMvc6Project.kproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
</PropertyGroup> | ||
<Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.Props" Condition="'$(VSToolsPath)' != ''" /> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>ff6605b6-3b46-4e1d-859c-626bec8aac0d</ProjectGuid> | ||
<RootNamespace>NewMvc6Project</RootNamespace> | ||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath> | ||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<DevelopmentServerPort>2993</DevelopmentServerPort> | ||
</PropertyGroup> | ||
<Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.targets" Condition="'$(VSToolsPath)' != ''" /> | ||
</Project> |
204 changes: 204 additions & 0 deletions
204
samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Project_Readme.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Welcome to ASP.NET 5</title> | ||
<style> | ||
html { | ||
background: #f1f1f1; | ||
height: 100%; | ||
} | ||
|
||
body { | ||
background: #fff; | ||
color: #505050; | ||
font: 14px 'Segoe UI', tahoma, arial, helvetica, sans-serif; | ||
margin: 1%; | ||
min-height: 95.5%; | ||
border: 1px solid silver; | ||
position: relative; | ||
} | ||
|
||
#header { | ||
padding: 0; | ||
} | ||
|
||
#header h1 { | ||
font-size: 44px; | ||
font-weight: normal; | ||
margin: 0; | ||
padding: 10px 30px 10px 30px; | ||
} | ||
|
||
#header span { | ||
margin: 0; | ||
padding: 0 30px; | ||
display: block; | ||
} | ||
|
||
#header p { | ||
font-size: 20px; | ||
color: #fff; | ||
background: #007acc; | ||
padding: 0 30px; | ||
line-height: 50px; | ||
margin-top: 25px; | ||
|
||
} | ||
|
||
#header p a { | ||
color: #fff; | ||
text-decoration: underline; | ||
font-weight: bold; | ||
padding-right: 35px; | ||
background: no-repeat right bottom url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAWCAMAAAAcqPc3AAAANlBMVEUAAAAAeswfitI9mthXp91us+KCvuaTx+mjz+2x1u+83PLH4vTR5/ba7Pjj8Pns9fv1+v3////wy3dWAAAAAXRSTlMAQObYZgAAAHxJREFUeNp9kVcSwCAIRMHUYoH7XzaxOxJ9P8oyQ1uIqNPwh3s2aLmIM2YtqrLcQIeQEylhuCeUOlhgve5yoBCfWmlnlgkN4H8ykbpaE7gR03AbUHiwoOxUH9Xp+ubd41p1HF3mBPrfC87BHeTdaB3ceeKL9HGpcvX9zu6+DdMWT9KQPvYAAAAASUVORK5CYII=); | ||
} | ||
|
||
#main { | ||
padding: 5px 30px; | ||
clear: both; | ||
} | ||
|
||
.section { | ||
width: 21.7%; | ||
float: left; | ||
margin: 0 0 0 4%; | ||
} | ||
|
||
.section h2 { | ||
font-size: 13px; | ||
text-transform: uppercase; | ||
margin: 0; | ||
border-bottom: 1px solid silver; | ||
padding-bottom: 12px; | ||
margin-bottom: 8px; | ||
} | ||
|
||
.section.first { | ||
margin-left: 0; | ||
} | ||
|
||
.section.first h2 { | ||
font-size: 24px; | ||
text-transform: none; | ||
margin-bottom: 25px; | ||
border: none; | ||
} | ||
|
||
.section.first li { | ||
border-top: 1px solid silver; | ||
padding: 8px 0; | ||
} | ||
|
||
.section.last { | ||
margin-right: 0; | ||
} | ||
|
||
ul { | ||
list-style: none; | ||
padding: 0; | ||
margin: 0; | ||
line-height: 20px; | ||
} | ||
|
||
li { | ||
padding: 4px 0; | ||
} | ||
|
||
a { | ||
color: #267cb2; | ||
text-decoration: none; | ||
} | ||
|
||
a:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
#footer { | ||
clear: both; | ||
padding-top: 50px; | ||
} | ||
|
||
#footer p { | ||
position: absolute; | ||
bottom: 10px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<div id="header"> | ||
<h1>Welcome to ASP.NET 5 Preview</h1> | ||
<span> | ||
We've made some big updates in this release, so it’s <b>important</b> that you spend | ||
a few minutes to learn what’s new. | ||
<br /><br /> | ||
ASP.NET 5 has been rearchitected to make it <b>lean</b> and <b>composable</b>. It's fully | ||
<b>open source</b> and available on <a href="http://go.microsoft.com/fwlink/?LinkID=517854">GitHub</a>. | ||
<br /> | ||
Your new project automatically takes advantage of modern client-side utilities | ||
like <a href="http://go.microsoft.com/fwlink/?LinkId=518004">Bower</a> and <a href="http://go.microsoft.com/fwlink/?LinkId=518005">npm</a> | ||
(to add client-side libraries) and <a href="http://go.microsoft.com/fwlink/?LinkId=518006">Grunt</a> and | ||
<a href="http://go.microsoft.com/fwlink/?LinkId=518007">Gulp</a> (for client-side build and automation tasks). | ||
|
||
<br /><br /> | ||
We hope you enjoy the new capabilities in ASP.NET 5 and Visual Studio 2015. | ||
<br /> | ||
The ASP.NET Team | ||
</span> | ||
<p>You've created a new ASP.NET 5 project. <a href="http://go.microsoft.com/fwlink/?LinkId=518016">Learn what's new</a></p> | ||
</div> | ||
|
||
<div id="main"> | ||
<div class="section first"> | ||
<h2>This application consists of:</h2> | ||
<ul> | ||
<li>Sample pages using ASP.NET MVC 6</li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=518006">Grunt</a> and <a href="http://go.microsoft.com/fwlink/?LinkId=518004">Bower</a> for managing client-side resources</li> | ||
<li>Theming using <a href="http://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li> | ||
</ul> | ||
</div> | ||
|
||
<div class="section"> | ||
<h2>New concepts</h2> | ||
<ul> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=518008">The 'wwwroot' explained</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=518012">Configuration in ASP.NET 5</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=518013">Dependency Injection</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=518014">Razor TagHelpers</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=517849">Manage client packages using Grunt</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=517850">Develop on different platforms</a></li> | ||
</ul> | ||
</div> | ||
|
||
<div class="section"> | ||
<h2>Customize app</h2> | ||
<ul> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=398600">Add Controllers and Views</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=398602">Add Data using EntityFramework</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=398603">Add Authentication using Identity</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=398606">Add real time support using SignalR</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=398604">Add Class library</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=518009">Add Web APIs with MVC 6</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=517848">Add client packages using Bower</a></li> | ||
</ul> | ||
</div> | ||
|
||
<div class="section last"> | ||
<h2>Deploy</h2> | ||
<ul> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=517851">Run your app locally</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=517852">Run your app on ASP.NET Core 5</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=517853">Run commands in your project.json</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Sites</a></li> | ||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=518019">Publish to the file system</a></li> | ||
</ul> | ||
</div> | ||
|
||
<div id="footer"> | ||
<p>We would love to hear your <a href="http://go.microsoft.com/fwlink/?LinkId=518015">feedback</a></p> | ||
</div> | ||
</div> | ||
|
||
</body> | ||
</html> |
39 changes: 39 additions & 0 deletions
39
samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Startup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" }); | ||
}); | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/Home/About.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@{ | ||
ViewBag.Title = "About"; | ||
} | ||
<h2>@ViewBag.Title.</h2> | ||
<h3>@ViewBag.Message</h3> | ||
|
||
<p>Use this area to provide additional information.</p> |
17 changes: 17 additions & 0 deletions
17
samples/MigratingFromMvc5/NewMvc6Project/src/NewMvc6Project/Views/Home/Contact.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@{ | ||
ViewBag.Title = "Contact"; | ||
} | ||
<h2>@ViewBag.Title.</h2> | ||
<h3>@ViewBag.Message</h3> | ||
|
||
<address> | ||
One Microsoft Way<br /> | ||
Redmond, WA 98052-6399<br /> | ||
<abbr title="Phone">P:</abbr> | ||
425.555.0100 | ||
</address> | ||
|
||
<address> | ||
<strong>Support:</strong> <a href="mailto:[email protected]">Support@example.com</a><br /> | ||
<strong>Marketing:</strong> <a href="mailto:[email protected]">Marketing@example.com</a> | ||
</address> |
Oops, something went wrong.