Baseline initial projects from .NET templates. Still no Docker, etc.
This commit is contained in:
		
							parent
							
								
									ae5c07cb0e
								
							
						
					
					
						commit
						42d10f343c
					
				
							
								
								
									
										63
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,63 @@ | ||||
| ############################################################################### | ||||
| # Set default behavior to automatically normalize line endings. | ||||
| ############################################################################### | ||||
| * text=auto | ||||
| 
 | ||||
| ############################################################################### | ||||
| # Set default behavior for command prompt diff. | ||||
| # | ||||
| # This is need for earlier builds of msysgit that does not have it on by | ||||
| # default for csharp files. | ||||
| # Note: This is only used by command line | ||||
| ############################################################################### | ||||
| #*.cs     diff=csharp | ||||
| 
 | ||||
| ############################################################################### | ||||
| # Set the merge driver for project and solution files | ||||
| # | ||||
| # Merging from the command prompt will add diff markers to the files if there | ||||
| # are conflicts (Merging from VS is not affected by the settings below, in VS | ||||
| # the diff markers are never inserted). Diff markers may cause the following  | ||||
| # file extensions to fail to load in VS. An alternative would be to treat | ||||
| # these files as binary and thus will always conflict and require user | ||||
| # intervention with every merge. To do so, just uncomment the entries below | ||||
| ############################################################################### | ||||
| #*.sln       merge=binary | ||||
| #*.csproj    merge=binary | ||||
| #*.vbproj    merge=binary | ||||
| #*.vcxproj   merge=binary | ||||
| #*.vcproj    merge=binary | ||||
| #*.dbproj    merge=binary | ||||
| #*.fsproj    merge=binary | ||||
| #*.lsproj    merge=binary | ||||
| #*.wixproj   merge=binary | ||||
| #*.modelproj merge=binary | ||||
| #*.sqlproj   merge=binary | ||||
| #*.wwaproj   merge=binary | ||||
| 
 | ||||
| ############################################################################### | ||||
| # behavior for image files | ||||
| # | ||||
| # image files are treated as binary by default. | ||||
| ############################################################################### | ||||
| #*.jpg   binary | ||||
| #*.png   binary | ||||
| #*.gif   binary | ||||
| 
 | ||||
| ############################################################################### | ||||
| # diff behavior for common document formats | ||||
| #  | ||||
| # Convert binary document formats to text before diffing them. This feature | ||||
| # is only available from the command line. Turn it on by uncommenting the  | ||||
| # entries below. | ||||
| ############################################################################### | ||||
| #*.doc   diff=astextplain | ||||
| #*.DOC   diff=astextplain | ||||
| #*.docx  diff=astextplain | ||||
| #*.DOCX  diff=astextplain | ||||
| #*.dot   diff=astextplain | ||||
| #*.DOT   diff=astextplain | ||||
| #*.pdf   diff=astextplain | ||||
| #*.PDF   diff=astextplain | ||||
| #*.rtf   diff=astextplain | ||||
| #*.RTF   diff=astextplain | ||||
							
								
								
									
										83
									
								
								Microsoft.Containerized-eShop.sln
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										83
									
								
								Microsoft.Containerized-eShop.sln
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,83 @@ | ||||
|  | ||||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||||
| # Visual Studio 14 | ||||
| VisualStudioVersion = 14.0.25420.1 | ||||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{932D8224-11F6-4D07-B109-DA28AD288A63}" | ||||
| EndProject | ||||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3AF739CD-81D8-428D-A08A-0A58372DEBF6}" | ||||
| 	ProjectSection(SolutionItems) = preProject | ||||
| 		global.json = global.json | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microservices", "Microservices", "{91CF7717-08AB-4E65-B10E-0B426F01E2E8}" | ||||
| EndProject | ||||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web Apps", "Web Apps", "{E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04}" | ||||
| EndProject | ||||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mobile Apps", "Mobile Apps", "{F61357CE-1CC2-410E-8776-B16EEBC98EB8}" | ||||
| 	ProjectSection(SolutionItems) = preProject | ||||
| 		src\Mobile\Xamarin projects when created.txt = src\Mobile\Xamarin projects when created.txt | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Containerized-eShop.WebMVC", "src\Web\Microsoft.Containerized-eShop.WebMVC\Microsoft.Containerized-eShop.WebMVC.xproj", "{1D40C583-ABF0-400B-8C63-2C3669268C8B}" | ||||
| EndProject | ||||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Catalog", "Catalog", "{326A7FB3-5295-468C-A4FE-67DCB823E1E5}" | ||||
| 	ProjectSection(SolutionItems) = preProject | ||||
| 		src\Microservices\Catalog\Additional related projects-images like DataSources or related microservices.txt = src\Microservices\Catalog\Additional related projects-images like DataSources or related microservices.txt | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Basket", "Basket", "{BF3EF4F3-E4F5-41DA-9D2D-57223687D1A8}" | ||||
| 	ProjectSection(SolutionItems) = preProject | ||||
| 		src\Microservices\Basket\Additional related projects-images like Redis Cache.txt = src\Microservices\Basket\Additional related projects-images like Redis Cache.txt | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ordering", "Ordering", "{0BD0DB92-2D98-44D9-9AC0-C59186D59B0B}" | ||||
| 	ProjectSection(SolutionItems) = preProject | ||||
| 		src\Microservices\Ordering\Additional projects-images like DataSources or Related microservices.txt = src\Microservices\Ordering\Additional projects-images like DataSources or Related microservices.txt | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Containerized-eShop.BasketAPI", "src\Microservices\Basket\Microsoft.Containerized-eShop.BasketAPI\Microsoft.Containerized-eShop.BasketAPI.xproj", "{F6A031AF-D7AE-47C1-AB53-1456A528280C}" | ||||
| EndProject | ||||
| Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Containerized-eShop.OrderingAPI", "src\Microservices\Ordering\Microsoft.Containerized-eShop.OrderingAPI\Microsoft.Containerized-eShop.OrderingAPI.xproj", "{941B2DBA-8827-447E-AC82-7BEB118A968B}" | ||||
| EndProject | ||||
| Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Containerized-eShop.CatalogAPI", "src\Microservices\Catalog\Microsoft.Containerized-eShop.CatalogAPI\Microsoft.Containerized-eShop.CatalogAPI.xproj", "{2D26AFB4-0ECB-4009-98D6-CAB5825E62A8}" | ||||
| EndProject | ||||
| Global | ||||
| 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
| 		Debug|Any CPU = Debug|Any CPU | ||||
| 		Release|Any CPU = Release|Any CPU | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||||
| 		{1D40C583-ABF0-400B-8C63-2C3669268C8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||||
| 		{1D40C583-ABF0-400B-8C63-2C3669268C8B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||
| 		{1D40C583-ABF0-400B-8C63-2C3669268C8B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||
| 		{1D40C583-ABF0-400B-8C63-2C3669268C8B}.Release|Any CPU.Build.0 = Release|Any CPU | ||||
| 		{F6A031AF-D7AE-47C1-AB53-1456A528280C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||||
| 		{F6A031AF-D7AE-47C1-AB53-1456A528280C}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||
| 		{F6A031AF-D7AE-47C1-AB53-1456A528280C}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||
| 		{F6A031AF-D7AE-47C1-AB53-1456A528280C}.Release|Any CPU.Build.0 = Release|Any CPU | ||||
| 		{941B2DBA-8827-447E-AC82-7BEB118A968B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||||
| 		{941B2DBA-8827-447E-AC82-7BEB118A968B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||
| 		{941B2DBA-8827-447E-AC82-7BEB118A968B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||
| 		{941B2DBA-8827-447E-AC82-7BEB118A968B}.Release|Any CPU.Build.0 = Release|Any CPU | ||||
| 		{2D26AFB4-0ECB-4009-98D6-CAB5825E62A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||||
| 		{2D26AFB4-0ECB-4009-98D6-CAB5825E62A8}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||
| 		{2D26AFB4-0ECB-4009-98D6-CAB5825E62A8}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||
| 		{2D26AFB4-0ECB-4009-98D6-CAB5825E62A8}.Release|Any CPU.Build.0 = Release|Any CPU | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(SolutionProperties) = preSolution | ||||
| 		HideSolutionNode = FALSE | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(NestedProjects) = preSolution | ||||
| 		{91CF7717-08AB-4E65-B10E-0B426F01E2E8} = {932D8224-11F6-4D07-B109-DA28AD288A63} | ||||
| 		{E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04} = {932D8224-11F6-4D07-B109-DA28AD288A63} | ||||
| 		{F61357CE-1CC2-410E-8776-B16EEBC98EB8} = {932D8224-11F6-4D07-B109-DA28AD288A63} | ||||
| 		{1D40C583-ABF0-400B-8C63-2C3669268C8B} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04} | ||||
| 		{326A7FB3-5295-468C-A4FE-67DCB823E1E5} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8} | ||||
| 		{BF3EF4F3-E4F5-41DA-9D2D-57223687D1A8} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8} | ||||
| 		{0BD0DB92-2D98-44D9-9AC0-C59186D59B0B} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8} | ||||
| 		{F6A031AF-D7AE-47C1-AB53-1456A528280C} = {BF3EF4F3-E4F5-41DA-9D2D-57223687D1A8} | ||||
| 		{941B2DBA-8827-447E-AC82-7BEB118A968B} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B} | ||||
| 		{2D26AFB4-0ECB-4009-98D6-CAB5825E62A8} = {326A7FB3-5295-468C-A4FE-67DCB823E1E5} | ||||
| 	EndGlobalSection | ||||
| EndGlobal | ||||
							
								
								
									
										6
									
								
								global.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								global.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,6 @@ | ||||
| { | ||||
|   "projects": [ "src", "test" ], | ||||
|   "sdk": { | ||||
|     "version": "1.0.0-preview2-003121" | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,44 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.BasketAPI.Controllers | ||||
| { | ||||
|     [Route("api/[controller]")]
 | ||||
|     public class ValuesController : Controller | ||||
|     { | ||||
|         // GET api/values | ||||
|         [HttpGet] | ||||
|         public IEnumerable<string> Get() | ||||
|         { | ||||
|             return new string[] { "value1", "value2" }; | ||||
|         } | ||||
| 
 | ||||
|         // GET api/values/5 | ||||
|         [HttpGet("{id}")] | ||||
|         public string Get(int id) | ||||
|         { | ||||
|             return "value"; | ||||
|         } | ||||
| 
 | ||||
|         // POST api/values | ||||
|         [HttpPost] | ||||
|         public void Post([FromBody]string value) | ||||
|         { | ||||
|         } | ||||
| 
 | ||||
|         // PUT api/values/5 | ||||
|         [HttpPut("{id}")] | ||||
|         public void Put(int id, [FromBody]string value) | ||||
|         { | ||||
|         } | ||||
| 
 | ||||
|         // DELETE api/values/5 | ||||
|         [HttpDelete("{id}")] | ||||
|         public void Delete(int id) | ||||
|         { | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -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)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> | ||||
|   <PropertyGroup Label="Globals"> | ||||
|     <ProjectGuid>f6a031af-d7ae-47c1-ab53-1456a528280c</ProjectGuid> | ||||
|     <RootNamespace>Microsoft.Containerized_eShop.BasketAPI</RootNamespace> | ||||
|     <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> | ||||
|     <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> | ||||
|     <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup> | ||||
|     <SchemaVersion>2.0</SchemaVersion> | ||||
|   </PropertyGroup> | ||||
|   <Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" /> | ||||
| </Project> | ||||
| @ -0,0 +1,25 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.IO; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Hosting; | ||||
| using Microsoft.AspNetCore.Builder; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.BasketAPI | ||||
| { | ||||
|     public class Program | ||||
|     { | ||||
|         public static void Main(string[] args) | ||||
|         { | ||||
|             var host = new WebHostBuilder() | ||||
|                 .UseKestrel() | ||||
|                 .UseContentRoot(Directory.GetCurrentDirectory()) | ||||
|                 .UseIISIntegration() | ||||
|                 .UseStartup<Startup>() | ||||
|                 .Build(); | ||||
| 
 | ||||
|             host.Run(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,187 @@ | ||||
| <!DOCTYPE html> | ||||
| <html lang="en"> | ||||
| <head> | ||||
|     <meta charset="utf-8" /> | ||||
|     <title>Welcome to ASP.NET Core</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 Core</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. | ||||
|         </span> | ||||
|         <p>You've created a new ASP.NET Core 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 Core MVC</li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=518004">Bower</a> for managing client-side libraries</li> | ||||
|                 <li>Theming using <a href="http://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li> | ||||
|             </ul> | ||||
|         </div> | ||||
|         <div class="section"> | ||||
|             <h2>How to</h2> | ||||
|             <ul> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699562">Add an appsetting in config and access it in app.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699318">Add client packages using Bower.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li> | ||||
|             </ul> | ||||
|         </div> | ||||
|         <div class="section"> | ||||
|             <h2>Overview</h2> | ||||
|             <ul> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li> | ||||
|             </ul> | ||||
|         </div> | ||||
|         <div class="section last"> | ||||
|             <h2>Run & Deploy</h2> | ||||
|             <ul> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</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> | ||||
| @ -0,0 +1,28 @@ | ||||
| { | ||||
|   "iisSettings": { | ||||
|     "windowsAuthentication": false, | ||||
|     "anonymousAuthentication": true, | ||||
|     "iisExpress": { | ||||
|       "applicationUrl": "http://localhost:2923/", | ||||
|       "sslPort": 0 | ||||
|     } | ||||
|   }, | ||||
|   "profiles": { | ||||
|     "IIS Express": { | ||||
|       "commandName": "IISExpress", | ||||
|       "launchBrowser": true, | ||||
|       "launchUrl": "api/values", | ||||
|       "environmentVariables": { | ||||
|         "ASPNETCORE_ENVIRONMENT": "Development" | ||||
|       } | ||||
|     }, | ||||
|     "Microsoft.Containerized_eShop.BasketAPI": { | ||||
|       "commandName": "Project", | ||||
|       "launchBrowser": true, | ||||
|       "launchUrl": "http://localhost:5000/api/values", | ||||
|       "environmentVariables": { | ||||
|         "ASPNETCORE_ENVIRONMENT": "Development" | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,43 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Builder; | ||||
| using Microsoft.AspNetCore.Hosting; | ||||
| using Microsoft.Extensions.Configuration; | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using Microsoft.Extensions.Logging; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.BasketAPI | ||||
| { | ||||
|     public class Startup | ||||
|     { | ||||
|         public Startup(IHostingEnvironment env) | ||||
|         { | ||||
|             var builder = new ConfigurationBuilder() | ||||
|                 .SetBasePath(env.ContentRootPath) | ||||
|                 .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) | ||||
|                 .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) | ||||
|                 .AddEnvironmentVariables(); | ||||
|             Configuration = builder.Build(); | ||||
|         } | ||||
| 
 | ||||
|         public IConfigurationRoot Configuration { get; } | ||||
| 
 | ||||
|         // This method gets called by the runtime. Use this method to add services to the container. | ||||
|         public void ConfigureServices(IServiceCollection services) | ||||
|         { | ||||
|             // Add framework services. | ||||
|             services.AddMvc(); | ||||
|         } | ||||
| 
 | ||||
|         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | ||||
|         public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) | ||||
|         { | ||||
|             loggerFactory.AddConsole(Configuration.GetSection("Logging")); | ||||
|             loggerFactory.AddDebug(); | ||||
| 
 | ||||
|             app.UseMvc(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,10 @@ | ||||
| { | ||||
|   "Logging": { | ||||
|     "IncludeScopes": false, | ||||
|     "LogLevel": { | ||||
|       "Default": "Debug", | ||||
|       "System": "Information", | ||||
|       "Microsoft": "Information" | ||||
|     } | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,56 @@ | ||||
| { | ||||
|   "dependencies": { | ||||
|     "Microsoft.NETCore.App": { | ||||
|       "version": "1.0.0", | ||||
|       "type": "platform" | ||||
|     }, | ||||
|     "Microsoft.AspNetCore.Mvc": "1.0.0", | ||||
|     "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", | ||||
|     "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", | ||||
|     "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", | ||||
|     "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0", | ||||
|     "Microsoft.Extensions.Configuration.Json": "1.0.0", | ||||
|     "Microsoft.Extensions.Logging": "1.0.0", | ||||
|     "Microsoft.Extensions.Logging.Console": "1.0.0", | ||||
|     "Microsoft.Extensions.Logging.Debug": "1.0.0", | ||||
|     "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0" | ||||
|   }, | ||||
| 
 | ||||
|   "tools": { | ||||
|     "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" | ||||
|   }, | ||||
| 
 | ||||
|   "frameworks": { | ||||
|     "netcoreapp1.0": { | ||||
|       "imports": [ | ||||
|         "dotnet5.6", | ||||
|         "portable-net45+win8" | ||||
|       ] | ||||
|     } | ||||
|   }, | ||||
| 
 | ||||
|   "buildOptions": { | ||||
|     "emitEntryPoint": true, | ||||
|     "preserveCompilationContext": true | ||||
|   }, | ||||
| 
 | ||||
|   "runtimeOptions": { | ||||
|     "configProperties": { | ||||
|       "System.GC.Server": true | ||||
|     } | ||||
|   }, | ||||
| 
 | ||||
|   "publishOptions": { | ||||
|     "include": [ | ||||
|       "wwwroot", | ||||
|       "Views", | ||||
|       "Areas/**/Views", | ||||
|       "appsettings.json", | ||||
|       "web.config" | ||||
|     ] | ||||
|   }, | ||||
| 
 | ||||
|   "scripts": { | ||||
|     "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,14 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <configuration> | ||||
| 
 | ||||
|   <!-- | ||||
|     Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380 | ||||
|   --> | ||||
| 
 | ||||
|   <system.webServer> | ||||
|     <handlers> | ||||
|       <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/> | ||||
|     </handlers> | ||||
|     <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/> | ||||
|   </system.webServer> | ||||
| </configuration> | ||||
| @ -0,0 +1,44 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.CatalogAPI.Controllers | ||||
| { | ||||
|     [Route("api/[controller]")]
 | ||||
|     public class ValuesController : Controller | ||||
|     { | ||||
|         // GET api/values | ||||
|         [HttpGet] | ||||
|         public IEnumerable<string> Get() | ||||
|         { | ||||
|             return new string[] { "value1", "value2" }; | ||||
|         } | ||||
| 
 | ||||
|         // GET api/values/5 | ||||
|         [HttpGet("{id}")] | ||||
|         public string Get(int id) | ||||
|         { | ||||
|             return "value"; | ||||
|         } | ||||
| 
 | ||||
|         // POST api/values | ||||
|         [HttpPost] | ||||
|         public void Post([FromBody]string value) | ||||
|         { | ||||
|         } | ||||
| 
 | ||||
|         // PUT api/values/5 | ||||
|         [HttpPut("{id}")] | ||||
|         public void Put(int id, [FromBody]string value) | ||||
|         { | ||||
|         } | ||||
| 
 | ||||
|         // DELETE api/values/5 | ||||
|         [HttpDelete("{id}")] | ||||
|         public void Delete(int id) | ||||
|         { | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -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)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> | ||||
|   <PropertyGroup Label="Globals"> | ||||
|     <ProjectGuid>2d26afb4-0ecb-4009-98d6-cab5825e62a8</ProjectGuid> | ||||
|     <RootNamespace>Microsoft.Containerized_eShop.CatalogAPI</RootNamespace> | ||||
|     <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> | ||||
|     <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> | ||||
|     <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup> | ||||
|     <SchemaVersion>2.0</SchemaVersion> | ||||
|   </PropertyGroup> | ||||
|   <Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" /> | ||||
| </Project> | ||||
| @ -0,0 +1,25 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.IO; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Hosting; | ||||
| using Microsoft.AspNetCore.Builder; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.CatalogAPI | ||||
| { | ||||
|     public class Program | ||||
|     { | ||||
|         public static void Main(string[] args) | ||||
|         { | ||||
|             var host = new WebHostBuilder() | ||||
|                 .UseKestrel() | ||||
|                 .UseContentRoot(Directory.GetCurrentDirectory()) | ||||
|                 .UseIISIntegration() | ||||
|                 .UseStartup<Startup>() | ||||
|                 .Build(); | ||||
| 
 | ||||
|             host.Run(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,187 @@ | ||||
| <!DOCTYPE html> | ||||
| <html lang="en"> | ||||
| <head> | ||||
|     <meta charset="utf-8" /> | ||||
|     <title>Welcome to ASP.NET Core</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 Core</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. | ||||
|         </span> | ||||
|         <p>You've created a new ASP.NET Core 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 Core MVC</li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=518004">Bower</a> for managing client-side libraries</li> | ||||
|                 <li>Theming using <a href="http://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li> | ||||
|             </ul> | ||||
|         </div> | ||||
|         <div class="section"> | ||||
|             <h2>How to</h2> | ||||
|             <ul> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699562">Add an appsetting in config and access it in app.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699318">Add client packages using Bower.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li> | ||||
|             </ul> | ||||
|         </div> | ||||
|         <div class="section"> | ||||
|             <h2>Overview</h2> | ||||
|             <ul> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li> | ||||
|             </ul> | ||||
|         </div> | ||||
|         <div class="section last"> | ||||
|             <h2>Run & Deploy</h2> | ||||
|             <ul> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</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> | ||||
| @ -0,0 +1,28 @@ | ||||
| { | ||||
|   "iisSettings": { | ||||
|     "windowsAuthentication": false, | ||||
|     "anonymousAuthentication": true, | ||||
|     "iisExpress": { | ||||
|       "applicationUrl": "http://localhost:2933/", | ||||
|       "sslPort": 0 | ||||
|     } | ||||
|   }, | ||||
|   "profiles": { | ||||
|     "IIS Express": { | ||||
|       "commandName": "IISExpress", | ||||
|       "launchBrowser": true, | ||||
|       "launchUrl": "api/values", | ||||
|       "environmentVariables": { | ||||
|         "ASPNETCORE_ENVIRONMENT": "Development" | ||||
|       } | ||||
|     }, | ||||
|     "Microsoft.Containerized_eShop.CatalogAPI": { | ||||
|       "commandName": "Project", | ||||
|       "launchBrowser": true, | ||||
|       "launchUrl": "http://localhost:5000/api/values", | ||||
|       "environmentVariables": { | ||||
|         "ASPNETCORE_ENVIRONMENT": "Development" | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,43 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Builder; | ||||
| using Microsoft.AspNetCore.Hosting; | ||||
| using Microsoft.Extensions.Configuration; | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using Microsoft.Extensions.Logging; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.CatalogAPI | ||||
| { | ||||
|     public class Startup | ||||
|     { | ||||
|         public Startup(IHostingEnvironment env) | ||||
|         { | ||||
|             var builder = new ConfigurationBuilder() | ||||
|                 .SetBasePath(env.ContentRootPath) | ||||
|                 .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) | ||||
|                 .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) | ||||
|                 .AddEnvironmentVariables(); | ||||
|             Configuration = builder.Build(); | ||||
|         } | ||||
| 
 | ||||
|         public IConfigurationRoot Configuration { get; } | ||||
| 
 | ||||
|         // This method gets called by the runtime. Use this method to add services to the container. | ||||
|         public void ConfigureServices(IServiceCollection services) | ||||
|         { | ||||
|             // Add framework services. | ||||
|             services.AddMvc(); | ||||
|         } | ||||
| 
 | ||||
|         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | ||||
|         public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) | ||||
|         { | ||||
|             loggerFactory.AddConsole(Configuration.GetSection("Logging")); | ||||
|             loggerFactory.AddDebug(); | ||||
| 
 | ||||
|             app.UseMvc(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,10 @@ | ||||
| { | ||||
|   "Logging": { | ||||
|     "IncludeScopes": false, | ||||
|     "LogLevel": { | ||||
|       "Default": "Debug", | ||||
|       "System": "Information", | ||||
|       "Microsoft": "Information" | ||||
|     } | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,56 @@ | ||||
| { | ||||
|   "dependencies": { | ||||
|     "Microsoft.NETCore.App": { | ||||
|       "version": "1.0.0", | ||||
|       "type": "platform" | ||||
|     }, | ||||
|     "Microsoft.AspNetCore.Mvc": "1.0.0", | ||||
|     "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", | ||||
|     "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", | ||||
|     "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", | ||||
|     "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0", | ||||
|     "Microsoft.Extensions.Configuration.Json": "1.0.0", | ||||
|     "Microsoft.Extensions.Logging": "1.0.0", | ||||
|     "Microsoft.Extensions.Logging.Console": "1.0.0", | ||||
|     "Microsoft.Extensions.Logging.Debug": "1.0.0", | ||||
|     "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0" | ||||
|   }, | ||||
| 
 | ||||
|   "tools": { | ||||
|     "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" | ||||
|   }, | ||||
| 
 | ||||
|   "frameworks": { | ||||
|     "netcoreapp1.0": { | ||||
|       "imports": [ | ||||
|         "dotnet5.6", | ||||
|         "portable-net45+win8" | ||||
|       ] | ||||
|     } | ||||
|   }, | ||||
| 
 | ||||
|   "buildOptions": { | ||||
|     "emitEntryPoint": true, | ||||
|     "preserveCompilationContext": true | ||||
|   }, | ||||
| 
 | ||||
|   "runtimeOptions": { | ||||
|     "configProperties": { | ||||
|       "System.GC.Server": true | ||||
|     } | ||||
|   }, | ||||
| 
 | ||||
|   "publishOptions": { | ||||
|     "include": [ | ||||
|       "wwwroot", | ||||
|       "Views", | ||||
|       "Areas/**/Views", | ||||
|       "appsettings.json", | ||||
|       "web.config" | ||||
|     ] | ||||
|   }, | ||||
| 
 | ||||
|   "scripts": { | ||||
|     "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,14 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <configuration> | ||||
| 
 | ||||
|   <!-- | ||||
|     Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380 | ||||
|   --> | ||||
| 
 | ||||
|   <system.webServer> | ||||
|     <handlers> | ||||
|       <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/> | ||||
|     </handlers> | ||||
|     <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/> | ||||
|   </system.webServer> | ||||
| </configuration> | ||||
| @ -0,0 +1,44 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.OrderingAPI.Controllers | ||||
| { | ||||
|     [Route("api/[controller]")]
 | ||||
|     public class ValuesController : Controller | ||||
|     { | ||||
|         // GET api/values | ||||
|         [HttpGet] | ||||
|         public IEnumerable<string> Get() | ||||
|         { | ||||
|             return new string[] { "value1", "value2" }; | ||||
|         } | ||||
| 
 | ||||
|         // GET api/values/5 | ||||
|         [HttpGet("{id}")] | ||||
|         public string Get(int id) | ||||
|         { | ||||
|             return "value"; | ||||
|         } | ||||
| 
 | ||||
|         // POST api/values | ||||
|         [HttpPost] | ||||
|         public void Post([FromBody]string value) | ||||
|         { | ||||
|         } | ||||
| 
 | ||||
|         // PUT api/values/5 | ||||
|         [HttpPut("{id}")] | ||||
|         public void Put(int id, [FromBody]string value) | ||||
|         { | ||||
|         } | ||||
| 
 | ||||
|         // DELETE api/values/5 | ||||
|         [HttpDelete("{id}")] | ||||
|         public void Delete(int id) | ||||
|         { | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -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)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> | ||||
|   <PropertyGroup Label="Globals"> | ||||
|     <ProjectGuid>941b2dba-8827-447e-ac82-7beb118a968b</ProjectGuid> | ||||
|     <RootNamespace>Microsoft.Containerized_eShop.OrderingAPI</RootNamespace> | ||||
|     <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> | ||||
|     <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> | ||||
|     <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup> | ||||
|     <SchemaVersion>2.0</SchemaVersion> | ||||
|   </PropertyGroup> | ||||
|   <Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" /> | ||||
| </Project> | ||||
| @ -0,0 +1,25 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.IO; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Hosting; | ||||
| using Microsoft.AspNetCore.Builder; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.OrderingAPI | ||||
| { | ||||
|     public class Program | ||||
|     { | ||||
|         public static void Main(string[] args) | ||||
|         { | ||||
|             var host = new WebHostBuilder() | ||||
|                 .UseKestrel() | ||||
|                 .UseContentRoot(Directory.GetCurrentDirectory()) | ||||
|                 .UseIISIntegration() | ||||
|                 .UseStartup<Startup>() | ||||
|                 .Build(); | ||||
| 
 | ||||
|             host.Run(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,187 @@ | ||||
| <!DOCTYPE html> | ||||
| <html lang="en"> | ||||
| <head> | ||||
|     <meta charset="utf-8" /> | ||||
|     <title>Welcome to ASP.NET Core</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 Core</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. | ||||
|         </span> | ||||
|         <p>You've created a new ASP.NET Core 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 Core MVC</li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=518004">Bower</a> for managing client-side libraries</li> | ||||
|                 <li>Theming using <a href="http://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li> | ||||
|             </ul> | ||||
|         </div> | ||||
|         <div class="section"> | ||||
|             <h2>How to</h2> | ||||
|             <ul> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699562">Add an appsetting in config and access it in app.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699318">Add client packages using Bower.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li> | ||||
|             </ul> | ||||
|         </div> | ||||
|         <div class="section"> | ||||
|             <h2>Overview</h2> | ||||
|             <ul> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li> | ||||
|             </ul> | ||||
|         </div> | ||||
|         <div class="section last"> | ||||
|             <h2>Run & Deploy</h2> | ||||
|             <ul> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</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> | ||||
| @ -0,0 +1,28 @@ | ||||
| { | ||||
|   "iisSettings": { | ||||
|     "windowsAuthentication": false, | ||||
|     "anonymousAuthentication": true, | ||||
|     "iisExpress": { | ||||
|       "applicationUrl": "http://localhost:2929/", | ||||
|       "sslPort": 0 | ||||
|     } | ||||
|   }, | ||||
|   "profiles": { | ||||
|     "IIS Express": { | ||||
|       "commandName": "IISExpress", | ||||
|       "launchBrowser": true, | ||||
|       "launchUrl": "api/values", | ||||
|       "environmentVariables": { | ||||
|         "ASPNETCORE_ENVIRONMENT": "Development" | ||||
|       } | ||||
|     }, | ||||
|     "Microsoft.Containerized_eShop.OrderingAPI": { | ||||
|       "commandName": "Project", | ||||
|       "launchBrowser": true, | ||||
|       "launchUrl": "http://localhost:5000/api/values", | ||||
|       "environmentVariables": { | ||||
|         "ASPNETCORE_ENVIRONMENT": "Development" | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,43 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Builder; | ||||
| using Microsoft.AspNetCore.Hosting; | ||||
| using Microsoft.Extensions.Configuration; | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using Microsoft.Extensions.Logging; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.OrderingAPI | ||||
| { | ||||
|     public class Startup | ||||
|     { | ||||
|         public Startup(IHostingEnvironment env) | ||||
|         { | ||||
|             var builder = new ConfigurationBuilder() | ||||
|                 .SetBasePath(env.ContentRootPath) | ||||
|                 .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) | ||||
|                 .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) | ||||
|                 .AddEnvironmentVariables(); | ||||
|             Configuration = builder.Build(); | ||||
|         } | ||||
| 
 | ||||
|         public IConfigurationRoot Configuration { get; } | ||||
| 
 | ||||
|         // This method gets called by the runtime. Use this method to add services to the container. | ||||
|         public void ConfigureServices(IServiceCollection services) | ||||
|         { | ||||
|             // Add framework services. | ||||
|             services.AddMvc(); | ||||
|         } | ||||
| 
 | ||||
|         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | ||||
|         public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) | ||||
|         { | ||||
|             loggerFactory.AddConsole(Configuration.GetSection("Logging")); | ||||
|             loggerFactory.AddDebug(); | ||||
| 
 | ||||
|             app.UseMvc(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,10 @@ | ||||
| { | ||||
|   "Logging": { | ||||
|     "IncludeScopes": false, | ||||
|     "LogLevel": { | ||||
|       "Default": "Debug", | ||||
|       "System": "Information", | ||||
|       "Microsoft": "Information" | ||||
|     } | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,56 @@ | ||||
| { | ||||
|   "dependencies": { | ||||
|     "Microsoft.NETCore.App": { | ||||
|       "version": "1.0.0", | ||||
|       "type": "platform" | ||||
|     }, | ||||
|     "Microsoft.AspNetCore.Mvc": "1.0.0", | ||||
|     "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", | ||||
|     "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", | ||||
|     "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", | ||||
|     "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0", | ||||
|     "Microsoft.Extensions.Configuration.Json": "1.0.0", | ||||
|     "Microsoft.Extensions.Logging": "1.0.0", | ||||
|     "Microsoft.Extensions.Logging.Console": "1.0.0", | ||||
|     "Microsoft.Extensions.Logging.Debug": "1.0.0", | ||||
|     "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0" | ||||
|   }, | ||||
| 
 | ||||
|   "tools": { | ||||
|     "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" | ||||
|   }, | ||||
| 
 | ||||
|   "frameworks": { | ||||
|     "netcoreapp1.0": { | ||||
|       "imports": [ | ||||
|         "dotnet5.6", | ||||
|         "portable-net45+win8" | ||||
|       ] | ||||
|     } | ||||
|   }, | ||||
| 
 | ||||
|   "buildOptions": { | ||||
|     "emitEntryPoint": true, | ||||
|     "preserveCompilationContext": true | ||||
|   }, | ||||
| 
 | ||||
|   "runtimeOptions": { | ||||
|     "configProperties": { | ||||
|       "System.GC.Server": true | ||||
|     } | ||||
|   }, | ||||
| 
 | ||||
|   "publishOptions": { | ||||
|     "include": [ | ||||
|       "wwwroot", | ||||
|       "Views", | ||||
|       "Areas/**/Views", | ||||
|       "appsettings.json", | ||||
|       "web.config" | ||||
|     ] | ||||
|   }, | ||||
| 
 | ||||
|   "scripts": { | ||||
|     "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,14 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <configuration> | ||||
| 
 | ||||
|   <!-- | ||||
|     Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380 | ||||
|   --> | ||||
| 
 | ||||
|   <system.webServer> | ||||
|     <handlers> | ||||
|       <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/> | ||||
|     </handlers> | ||||
|     <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/> | ||||
|   </system.webServer> | ||||
| </configuration> | ||||
							
								
								
									
										0
									
								
								src/Mobile/Xamarin projects when created.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/Mobile/Xamarin projects when created.txt
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										3
									
								
								src/Web/Microsoft.Containerized-eShop.WebMVC/.bowerrc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/Web/Microsoft.Containerized-eShop.WebMVC/.bowerrc
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| { | ||||
|   "directory": "wwwroot/lib" | ||||
| } | ||||
| @ -0,0 +1,468 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Security.Claims; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Authorization; | ||||
| using Microsoft.AspNetCore.Identity; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| using Microsoft.AspNetCore.Mvc.Rendering; | ||||
| using Microsoft.Extensions.Logging; | ||||
| using Microsoft.Containerized_eShop.WebMVC.Models; | ||||
| using Microsoft.Containerized_eShop.WebMVC.Models.AccountViewModels; | ||||
| using Microsoft.Containerized_eShop.WebMVC.Services; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Controllers | ||||
| { | ||||
|     [Authorize] | ||||
|     public class AccountController : Controller | ||||
|     { | ||||
|         private readonly UserManager<ApplicationUser> _userManager; | ||||
|         private readonly SignInManager<ApplicationUser> _signInManager; | ||||
|         private readonly IEmailSender _emailSender; | ||||
|         private readonly ISmsSender _smsSender; | ||||
|         private readonly ILogger _logger; | ||||
| 
 | ||||
|         public AccountController( | ||||
|             UserManager<ApplicationUser> userManager, | ||||
|             SignInManager<ApplicationUser> signInManager, | ||||
|             IEmailSender emailSender, | ||||
|             ISmsSender smsSender, | ||||
|             ILoggerFactory loggerFactory) | ||||
|         { | ||||
|             _userManager = userManager; | ||||
|             _signInManager = signInManager; | ||||
|             _emailSender = emailSender; | ||||
|             _smsSender = smsSender; | ||||
|             _logger = loggerFactory.CreateLogger<AccountController>(); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Account/Login | ||||
|         [HttpGet] | ||||
|         [AllowAnonymous] | ||||
|         public IActionResult Login(string returnUrl = null) | ||||
|         { | ||||
|             ViewData["ReturnUrl"] = returnUrl; | ||||
|             return View(); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Account/Login | ||||
|         [HttpPost] | ||||
|         [AllowAnonymous] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> Login(LoginViewModel model, string returnUrl = null) | ||||
|         { | ||||
|             ViewData["ReturnUrl"] = returnUrl; | ||||
|             if (ModelState.IsValid) | ||||
|             { | ||||
|                 // This doesn't count login failures towards account lockout | ||||
|                 // To enable password failures to trigger account lockout, set lockoutOnFailure: true | ||||
|                 var result = await _signInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, lockoutOnFailure: false); | ||||
|                 if (result.Succeeded) | ||||
|                 { | ||||
|                     _logger.LogInformation(1, "User logged in."); | ||||
|                     return RedirectToLocal(returnUrl); | ||||
|                 } | ||||
|                 if (result.RequiresTwoFactor) | ||||
|                 { | ||||
|                     return RedirectToAction(nameof(SendCode), new { ReturnUrl = returnUrl, RememberMe = model.RememberMe }); | ||||
|                 } | ||||
|                 if (result.IsLockedOut) | ||||
|                 { | ||||
|                     _logger.LogWarning(2, "User account locked out."); | ||||
|                     return View("Lockout"); | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     ModelState.AddModelError(string.Empty, "Invalid login attempt."); | ||||
|                     return View(model); | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             // If we got this far, something failed, redisplay form | ||||
|             return View(model); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Account/Register | ||||
|         [HttpGet] | ||||
|         [AllowAnonymous] | ||||
|         public IActionResult Register(string returnUrl = null) | ||||
|         { | ||||
|             ViewData["ReturnUrl"] = returnUrl; | ||||
|             return View(); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Account/Register | ||||
|         [HttpPost] | ||||
|         [AllowAnonymous] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> Register(RegisterViewModel model, string returnUrl = null) | ||||
|         { | ||||
|             ViewData["ReturnUrl"] = returnUrl; | ||||
|             if (ModelState.IsValid) | ||||
|             { | ||||
|                 var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; | ||||
|                 var result = await _userManager.CreateAsync(user, model.Password); | ||||
|                 if (result.Succeeded) | ||||
|                 { | ||||
|                     // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713 | ||||
|                     // Send an email with this link | ||||
|                     //var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); | ||||
|                     //var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme); | ||||
|                     //await _emailSender.SendEmailAsync(model.Email, "Confirm your account", | ||||
|                     //    $"Please confirm your account by clicking this link: <a href='{callbackUrl}'>link</a>"); | ||||
|                     await _signInManager.SignInAsync(user, isPersistent: false); | ||||
|                     _logger.LogInformation(3, "User created a new account with password."); | ||||
|                     return RedirectToLocal(returnUrl); | ||||
|                 } | ||||
|                 AddErrors(result); | ||||
|             } | ||||
| 
 | ||||
|             // If we got this far, something failed, redisplay form | ||||
|             return View(model); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Account/LogOff | ||||
|         [HttpPost] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> LogOff() | ||||
|         { | ||||
|             await _signInManager.SignOutAsync(); | ||||
|             _logger.LogInformation(4, "User logged out."); | ||||
|             return RedirectToAction(nameof(HomeController.Index), "Home"); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Account/ExternalLogin | ||||
|         [HttpPost] | ||||
|         [AllowAnonymous] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public IActionResult ExternalLogin(string provider, string returnUrl = null) | ||||
|         { | ||||
|             // Request a redirect to the external login provider. | ||||
|             var redirectUrl = Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl }); | ||||
|             var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl); | ||||
|             return Challenge(properties, provider); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Account/ExternalLoginCallback | ||||
|         [HttpGet] | ||||
|         [AllowAnonymous] | ||||
|         public async Task<IActionResult> ExternalLoginCallback(string returnUrl = null, string remoteError = null) | ||||
|         { | ||||
|             if (remoteError != null) | ||||
|             { | ||||
|                 ModelState.AddModelError(string.Empty, $"Error from external provider: {remoteError}"); | ||||
|                 return View(nameof(Login)); | ||||
|             } | ||||
|             var info = await _signInManager.GetExternalLoginInfoAsync(); | ||||
|             if (info == null) | ||||
|             { | ||||
|                 return RedirectToAction(nameof(Login)); | ||||
|             } | ||||
| 
 | ||||
|             // Sign in the user with this external login provider if the user already has a login. | ||||
|             var result = await _signInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, isPersistent: false); | ||||
|             if (result.Succeeded) | ||||
|             { | ||||
|                 _logger.LogInformation(5, "User logged in with {Name} provider.", info.LoginProvider); | ||||
|                 return RedirectToLocal(returnUrl); | ||||
|             } | ||||
|             if (result.RequiresTwoFactor) | ||||
|             { | ||||
|                 return RedirectToAction(nameof(SendCode), new { ReturnUrl = returnUrl }); | ||||
|             } | ||||
|             if (result.IsLockedOut) | ||||
|             { | ||||
|                 return View("Lockout"); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 // If the user does not have an account, then ask the user to create an account. | ||||
|                 ViewData["ReturnUrl"] = returnUrl; | ||||
|                 ViewData["LoginProvider"] = info.LoginProvider; | ||||
|                 var email = info.Principal.FindFirstValue(ClaimTypes.Email); | ||||
|                 return View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { Email = email }); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Account/ExternalLoginConfirmation | ||||
|         [HttpPost] | ||||
|         [AllowAnonymous] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl = null) | ||||
|         { | ||||
|             if (ModelState.IsValid) | ||||
|             { | ||||
|                 // Get the information about the user from the external login provider | ||||
|                 var info = await _signInManager.GetExternalLoginInfoAsync(); | ||||
|                 if (info == null) | ||||
|                 { | ||||
|                     return View("ExternalLoginFailure"); | ||||
|                 } | ||||
|                 var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; | ||||
|                 var result = await _userManager.CreateAsync(user); | ||||
|                 if (result.Succeeded) | ||||
|                 { | ||||
|                     result = await _userManager.AddLoginAsync(user, info); | ||||
|                     if (result.Succeeded) | ||||
|                     { | ||||
|                         await _signInManager.SignInAsync(user, isPersistent: false); | ||||
|                         _logger.LogInformation(6, "User created an account using {Name} provider.", info.LoginProvider); | ||||
|                         return RedirectToLocal(returnUrl); | ||||
|                     } | ||||
|                 } | ||||
|                 AddErrors(result); | ||||
|             } | ||||
| 
 | ||||
|             ViewData["ReturnUrl"] = returnUrl; | ||||
|             return View(model); | ||||
|         } | ||||
| 
 | ||||
|         // GET: /Account/ConfirmEmail | ||||
|         [HttpGet] | ||||
|         [AllowAnonymous] | ||||
|         public async Task<IActionResult> ConfirmEmail(string userId, string code) | ||||
|         { | ||||
|             if (userId == null || code == null) | ||||
|             { | ||||
|                 return View("Error"); | ||||
|             } | ||||
|             var user = await _userManager.FindByIdAsync(userId); | ||||
|             if (user == null) | ||||
|             { | ||||
|                 return View("Error"); | ||||
|             } | ||||
|             var result = await _userManager.ConfirmEmailAsync(user, code); | ||||
|             return View(result.Succeeded ? "ConfirmEmail" : "Error"); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Account/ForgotPassword | ||||
|         [HttpGet] | ||||
|         [AllowAnonymous] | ||||
|         public IActionResult ForgotPassword() | ||||
|         { | ||||
|             return View(); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Account/ForgotPassword | ||||
|         [HttpPost] | ||||
|         [AllowAnonymous] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> ForgotPassword(ForgotPasswordViewModel model) | ||||
|         { | ||||
|             if (ModelState.IsValid) | ||||
|             { | ||||
|                 var user = await _userManager.FindByNameAsync(model.Email); | ||||
|                 if (user == null || !(await _userManager.IsEmailConfirmedAsync(user))) | ||||
|                 { | ||||
|                     // Don't reveal that the user does not exist or is not confirmed | ||||
|                     return View("ForgotPasswordConfirmation"); | ||||
|                 } | ||||
| 
 | ||||
|                 // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713 | ||||
|                 // Send an email with this link | ||||
|                 //var code = await _userManager.GeneratePasswordResetTokenAsync(user); | ||||
|                 //var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme); | ||||
|                 //await _emailSender.SendEmailAsync(model.Email, "Reset Password", | ||||
|                 //   $"Please reset your password by clicking here: <a href='{callbackUrl}'>link</a>"); | ||||
|                 //return View("ForgotPasswordConfirmation"); | ||||
|             } | ||||
| 
 | ||||
|             // If we got this far, something failed, redisplay form | ||||
|             return View(model); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Account/ForgotPasswordConfirmation | ||||
|         [HttpGet] | ||||
|         [AllowAnonymous] | ||||
|         public IActionResult ForgotPasswordConfirmation() | ||||
|         { | ||||
|             return View(); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Account/ResetPassword | ||||
|         [HttpGet] | ||||
|         [AllowAnonymous] | ||||
|         public IActionResult ResetPassword(string code = null) | ||||
|         { | ||||
|             return code == null ? View("Error") : View(); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Account/ResetPassword | ||||
|         [HttpPost] | ||||
|         [AllowAnonymous] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> ResetPassword(ResetPasswordViewModel model) | ||||
|         { | ||||
|             if (!ModelState.IsValid) | ||||
|             { | ||||
|                 return View(model); | ||||
|             } | ||||
|             var user = await _userManager.FindByNameAsync(model.Email); | ||||
|             if (user == null) | ||||
|             { | ||||
|                 // Don't reveal that the user does not exist | ||||
|                 return RedirectToAction(nameof(AccountController.ResetPasswordConfirmation), "Account"); | ||||
|             } | ||||
|             var result = await _userManager.ResetPasswordAsync(user, model.Code, model.Password); | ||||
|             if (result.Succeeded) | ||||
|             { | ||||
|                 return RedirectToAction(nameof(AccountController.ResetPasswordConfirmation), "Account"); | ||||
|             } | ||||
|             AddErrors(result); | ||||
|             return View(); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Account/ResetPasswordConfirmation | ||||
|         [HttpGet] | ||||
|         [AllowAnonymous] | ||||
|         public IActionResult ResetPasswordConfirmation() | ||||
|         { | ||||
|             return View(); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Account/SendCode | ||||
|         [HttpGet] | ||||
|         [AllowAnonymous] | ||||
|         public async Task<ActionResult> SendCode(string returnUrl = null, bool rememberMe = false) | ||||
|         { | ||||
|             var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); | ||||
|             if (user == null) | ||||
|             { | ||||
|                 return View("Error"); | ||||
|             } | ||||
|             var userFactors = await _userManager.GetValidTwoFactorProvidersAsync(user); | ||||
|             var factorOptions = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList(); | ||||
|             return View(new SendCodeViewModel { Providers = factorOptions, ReturnUrl = returnUrl, RememberMe = rememberMe }); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Account/SendCode | ||||
|         [HttpPost] | ||||
|         [AllowAnonymous] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> SendCode(SendCodeViewModel model) | ||||
|         { | ||||
|             if (!ModelState.IsValid) | ||||
|             { | ||||
|                 return View(); | ||||
|             } | ||||
| 
 | ||||
|             var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); | ||||
|             if (user == null) | ||||
|             { | ||||
|                 return View("Error"); | ||||
|             } | ||||
| 
 | ||||
|             // Generate the token and send it | ||||
|             var code = await _userManager.GenerateTwoFactorTokenAsync(user, model.SelectedProvider); | ||||
|             if (string.IsNullOrWhiteSpace(code)) | ||||
|             { | ||||
|                 return View("Error"); | ||||
|             } | ||||
| 
 | ||||
|             var message = "Your security code is: " + code; | ||||
|             if (model.SelectedProvider == "Email") | ||||
|             { | ||||
|                 await _emailSender.SendEmailAsync(await _userManager.GetEmailAsync(user), "Security Code", message); | ||||
|             } | ||||
|             else if (model.SelectedProvider == "Phone") | ||||
|             { | ||||
|                 await _smsSender.SendSmsAsync(await _userManager.GetPhoneNumberAsync(user), message); | ||||
|             } | ||||
| 
 | ||||
|             return RedirectToAction(nameof(VerifyCode), new { Provider = model.SelectedProvider, ReturnUrl = model.ReturnUrl, RememberMe = model.RememberMe }); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Account/VerifyCode | ||||
|         [HttpGet] | ||||
|         [AllowAnonymous] | ||||
|         public async Task<IActionResult> VerifyCode(string provider, bool rememberMe, string returnUrl = null) | ||||
|         { | ||||
|             // Require that the user has already logged in via username/password or external login | ||||
|             var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); | ||||
|             if (user == null) | ||||
|             { | ||||
|                 return View("Error"); | ||||
|             } | ||||
|             return View(new VerifyCodeViewModel { Provider = provider, ReturnUrl = returnUrl, RememberMe = rememberMe }); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Account/VerifyCode | ||||
|         [HttpPost] | ||||
|         [AllowAnonymous] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> VerifyCode(VerifyCodeViewModel model) | ||||
|         { | ||||
|             if (!ModelState.IsValid) | ||||
|             { | ||||
|                 return View(model); | ||||
|             } | ||||
| 
 | ||||
|             // The following code protects for brute force attacks against the two factor codes. | ||||
|             // If a user enters incorrect codes for a specified amount of time then the user account | ||||
|             // will be locked out for a specified amount of time. | ||||
|             var result = await _signInManager.TwoFactorSignInAsync(model.Provider, model.Code, model.RememberMe, model.RememberBrowser); | ||||
|             if (result.Succeeded) | ||||
|             { | ||||
|                 return RedirectToLocal(model.ReturnUrl); | ||||
|             } | ||||
|             if (result.IsLockedOut) | ||||
|             { | ||||
|                 _logger.LogWarning(7, "User account locked out."); | ||||
|                 return View("Lockout"); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 ModelState.AddModelError(string.Empty, "Invalid code."); | ||||
|                 return View(model); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         #region Helpers | ||||
| 
 | ||||
|         private void AddErrors(IdentityResult result) | ||||
|         { | ||||
|             foreach (var error in result.Errors) | ||||
|             { | ||||
|                 ModelState.AddModelError(string.Empty, error.Description); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         private Task<ApplicationUser> GetCurrentUserAsync() | ||||
|         { | ||||
|             return _userManager.GetUserAsync(HttpContext.User); | ||||
|         } | ||||
| 
 | ||||
|         private IActionResult RedirectToLocal(string returnUrl) | ||||
|         { | ||||
|             if (Url.IsLocalUrl(returnUrl)) | ||||
|             { | ||||
|                 return Redirect(returnUrl); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 return RedirectToAction(nameof(HomeController.Index), "Home"); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         #endregion | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,35 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Controllers | ||||
| { | ||||
|     public class HomeController : Controller | ||||
|     { | ||||
|         public IActionResult Index() | ||||
|         { | ||||
|             return View(); | ||||
|         } | ||||
| 
 | ||||
|         public IActionResult About() | ||||
|         { | ||||
|             ViewData["Message"] = "Your application description page."; | ||||
| 
 | ||||
|             return View(); | ||||
|         } | ||||
| 
 | ||||
|         public IActionResult Contact() | ||||
|         { | ||||
|             ViewData["Message"] = "Your contact page."; | ||||
| 
 | ||||
|             return View(); | ||||
|         } | ||||
| 
 | ||||
|         public IActionResult Error() | ||||
|         { | ||||
|             return View(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,360 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Authorization; | ||||
| using Microsoft.AspNetCore.Identity; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| using Microsoft.Extensions.Logging; | ||||
| using Microsoft.Containerized_eShop.WebMVC.Models; | ||||
| using Microsoft.Containerized_eShop.WebMVC.Models.ManageViewModels; | ||||
| using Microsoft.Containerized_eShop.WebMVC.Services; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Controllers | ||||
| { | ||||
|     [Authorize] | ||||
|     public class ManageController : Controller | ||||
|     { | ||||
|         private readonly UserManager<ApplicationUser> _userManager; | ||||
|         private readonly SignInManager<ApplicationUser> _signInManager; | ||||
|         private readonly IEmailSender _emailSender; | ||||
|         private readonly ISmsSender _smsSender; | ||||
|         private readonly ILogger _logger; | ||||
| 
 | ||||
|         public ManageController( | ||||
|         UserManager<ApplicationUser> userManager, | ||||
|         SignInManager<ApplicationUser> signInManager, | ||||
|         IEmailSender emailSender, | ||||
|         ISmsSender smsSender, | ||||
|         ILoggerFactory loggerFactory) | ||||
|         { | ||||
|             _userManager = userManager; | ||||
|             _signInManager = signInManager; | ||||
|             _emailSender = emailSender; | ||||
|             _smsSender = smsSender; | ||||
|             _logger = loggerFactory.CreateLogger<ManageController>(); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Manage/Index | ||||
|         [HttpGet] | ||||
|         public async Task<IActionResult> Index(ManageMessageId? message = null) | ||||
|         { | ||||
|             ViewData["StatusMessage"] = | ||||
|                 message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." | ||||
|                 : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." | ||||
|                 : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." | ||||
|                 : message == ManageMessageId.Error ? "An error has occurred." | ||||
|                 : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." | ||||
|                 : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." | ||||
|                 : ""; | ||||
| 
 | ||||
|             var user = await GetCurrentUserAsync(); | ||||
|             if (user == null) | ||||
|             { | ||||
|                 return View("Error"); | ||||
|             } | ||||
|             var model = new IndexViewModel | ||||
|             { | ||||
|                 HasPassword = await _userManager.HasPasswordAsync(user), | ||||
|                 PhoneNumber = await _userManager.GetPhoneNumberAsync(user), | ||||
|                 TwoFactor = await _userManager.GetTwoFactorEnabledAsync(user), | ||||
|                 Logins = await _userManager.GetLoginsAsync(user), | ||||
|                 BrowserRemembered = await _signInManager.IsTwoFactorClientRememberedAsync(user) | ||||
|             }; | ||||
|             return View(model); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Manage/RemoveLogin | ||||
|         [HttpPost] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> RemoveLogin(RemoveLoginViewModel account) | ||||
|         { | ||||
|             ManageMessageId? message = ManageMessageId.Error; | ||||
|             var user = await GetCurrentUserAsync(); | ||||
|             if (user != null) | ||||
|             { | ||||
|                 var result = await _userManager.RemoveLoginAsync(user, account.LoginProvider, account.ProviderKey); | ||||
|                 if (result.Succeeded) | ||||
|                 { | ||||
|                     await _signInManager.SignInAsync(user, isPersistent: false); | ||||
|                     message = ManageMessageId.RemoveLoginSuccess; | ||||
|                 } | ||||
|             } | ||||
|             return RedirectToAction(nameof(ManageLogins), new { Message = message }); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Manage/AddPhoneNumber | ||||
|         public IActionResult AddPhoneNumber() | ||||
|         { | ||||
|             return View(); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Manage/AddPhoneNumber | ||||
|         [HttpPost] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> AddPhoneNumber(AddPhoneNumberViewModel model) | ||||
|         { | ||||
|             if (!ModelState.IsValid) | ||||
|             { | ||||
|                 return View(model); | ||||
|             } | ||||
|             // Generate the token and send it | ||||
|             var user = await GetCurrentUserAsync(); | ||||
|             if (user == null) | ||||
|             { | ||||
|                 return View("Error"); | ||||
|             } | ||||
|             var code = await _userManager.GenerateChangePhoneNumberTokenAsync(user, model.PhoneNumber); | ||||
|             await _smsSender.SendSmsAsync(model.PhoneNumber, "Your security code is: " + code); | ||||
|             return RedirectToAction(nameof(VerifyPhoneNumber), new { PhoneNumber = model.PhoneNumber }); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Manage/EnableTwoFactorAuthentication | ||||
|         [HttpPost] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> EnableTwoFactorAuthentication() | ||||
|         { | ||||
|             var user = await GetCurrentUserAsync(); | ||||
|             if (user != null) | ||||
|             { | ||||
|                 await _userManager.SetTwoFactorEnabledAsync(user, true); | ||||
|                 await _signInManager.SignInAsync(user, isPersistent: false); | ||||
|                 _logger.LogInformation(1, "User enabled two-factor authentication."); | ||||
|             } | ||||
|             return RedirectToAction(nameof(Index), "Manage"); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Manage/DisableTwoFactorAuthentication | ||||
|         [HttpPost] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> DisableTwoFactorAuthentication() | ||||
|         { | ||||
|             var user = await GetCurrentUserAsync(); | ||||
|             if (user != null) | ||||
|             { | ||||
|                 await _userManager.SetTwoFactorEnabledAsync(user, false); | ||||
|                 await _signInManager.SignInAsync(user, isPersistent: false); | ||||
|                 _logger.LogInformation(2, "User disabled two-factor authentication."); | ||||
|             } | ||||
|             return RedirectToAction(nameof(Index), "Manage"); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Manage/VerifyPhoneNumber | ||||
|         [HttpGet] | ||||
|         public async Task<IActionResult> VerifyPhoneNumber(string phoneNumber) | ||||
|         { | ||||
|             var user = await GetCurrentUserAsync(); | ||||
|             if (user == null) | ||||
|             { | ||||
|                 return View("Error"); | ||||
|             } | ||||
|             var code = await _userManager.GenerateChangePhoneNumberTokenAsync(user, phoneNumber); | ||||
|             // Send an SMS to verify the phone number | ||||
|             return phoneNumber == null ? View("Error") : View(new VerifyPhoneNumberViewModel { PhoneNumber = phoneNumber }); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Manage/VerifyPhoneNumber | ||||
|         [HttpPost] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> VerifyPhoneNumber(VerifyPhoneNumberViewModel model) | ||||
|         { | ||||
|             if (!ModelState.IsValid) | ||||
|             { | ||||
|                 return View(model); | ||||
|             } | ||||
|             var user = await GetCurrentUserAsync(); | ||||
|             if (user != null) | ||||
|             { | ||||
|                 var result = await _userManager.ChangePhoneNumberAsync(user, model.PhoneNumber, model.Code); | ||||
|                 if (result.Succeeded) | ||||
|                 { | ||||
|                     await _signInManager.SignInAsync(user, isPersistent: false); | ||||
|                     return RedirectToAction(nameof(Index), new { Message = ManageMessageId.AddPhoneSuccess }); | ||||
|                 } | ||||
|             } | ||||
|             // If we got this far, something failed, redisplay the form | ||||
|             ModelState.AddModelError(string.Empty, "Failed to verify phone number"); | ||||
|             return View(model); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Manage/RemovePhoneNumber | ||||
|         [HttpPost] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> RemovePhoneNumber() | ||||
|         { | ||||
|             var user = await GetCurrentUserAsync(); | ||||
|             if (user != null) | ||||
|             { | ||||
|                 var result = await _userManager.SetPhoneNumberAsync(user, null); | ||||
|                 if (result.Succeeded) | ||||
|                 { | ||||
|                     await _signInManager.SignInAsync(user, isPersistent: false); | ||||
|                     return RedirectToAction(nameof(Index), new { Message = ManageMessageId.RemovePhoneSuccess }); | ||||
|                 } | ||||
|             } | ||||
|             return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Manage/ChangePassword | ||||
|         [HttpGet] | ||||
|         public IActionResult ChangePassword() | ||||
|         { | ||||
|             return View(); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Manage/ChangePassword | ||||
|         [HttpPost] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> ChangePassword(ChangePasswordViewModel model) | ||||
|         { | ||||
|             if (!ModelState.IsValid) | ||||
|             { | ||||
|                 return View(model); | ||||
|             } | ||||
|             var user = await GetCurrentUserAsync(); | ||||
|             if (user != null) | ||||
|             { | ||||
|                 var result = await _userManager.ChangePasswordAsync(user, model.OldPassword, model.NewPassword); | ||||
|                 if (result.Succeeded) | ||||
|                 { | ||||
|                     await _signInManager.SignInAsync(user, isPersistent: false); | ||||
|                     _logger.LogInformation(3, "User changed their password successfully."); | ||||
|                     return RedirectToAction(nameof(Index), new { Message = ManageMessageId.ChangePasswordSuccess }); | ||||
|                 } | ||||
|                 AddErrors(result); | ||||
|                 return View(model); | ||||
|             } | ||||
|             return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Manage/SetPassword | ||||
|         [HttpGet] | ||||
|         public IActionResult SetPassword() | ||||
|         { | ||||
|             return View(); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Manage/SetPassword | ||||
|         [HttpPost] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public async Task<IActionResult> SetPassword(SetPasswordViewModel model) | ||||
|         { | ||||
|             if (!ModelState.IsValid) | ||||
|             { | ||||
|                 return View(model); | ||||
|             } | ||||
| 
 | ||||
|             var user = await GetCurrentUserAsync(); | ||||
|             if (user != null) | ||||
|             { | ||||
|                 var result = await _userManager.AddPasswordAsync(user, model.NewPassword); | ||||
|                 if (result.Succeeded) | ||||
|                 { | ||||
|                     await _signInManager.SignInAsync(user, isPersistent: false); | ||||
|                     return RedirectToAction(nameof(Index), new { Message = ManageMessageId.SetPasswordSuccess }); | ||||
|                 } | ||||
|                 AddErrors(result); | ||||
|                 return View(model); | ||||
|             } | ||||
|             return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); | ||||
|         } | ||||
| 
 | ||||
|         //GET: /Manage/ManageLogins | ||||
|         [HttpGet] | ||||
|         public async Task<IActionResult> ManageLogins(ManageMessageId? message = null) | ||||
|         { | ||||
|             ViewData["StatusMessage"] = | ||||
|                 message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed." | ||||
|                 : message == ManageMessageId.AddLoginSuccess ? "The external login was added." | ||||
|                 : message == ManageMessageId.Error ? "An error has occurred." | ||||
|                 : ""; | ||||
|             var user = await GetCurrentUserAsync(); | ||||
|             if (user == null) | ||||
|             { | ||||
|                 return View("Error"); | ||||
|             } | ||||
|             var userLogins = await _userManager.GetLoginsAsync(user); | ||||
|             var otherLogins = _signInManager.GetExternalAuthenticationSchemes().Where(auth => userLogins.All(ul => auth.AuthenticationScheme != ul.LoginProvider)).ToList(); | ||||
|             ViewData["ShowRemoveButton"] = user.PasswordHash != null || userLogins.Count > 1; | ||||
|             return View(new ManageLoginsViewModel | ||||
|             { | ||||
|                 CurrentLogins = userLogins, | ||||
|                 OtherLogins = otherLogins | ||||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // POST: /Manage/LinkLogin | ||||
|         [HttpPost] | ||||
|         [ValidateAntiForgeryToken] | ||||
|         public IActionResult LinkLogin(string provider) | ||||
|         { | ||||
|             // Request a redirect to the external login provider to link a login for the current user | ||||
|             var redirectUrl = Url.Action("LinkLoginCallback", "Manage"); | ||||
|             var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl, _userManager.GetUserId(User)); | ||||
|             return Challenge(properties, provider); | ||||
|         } | ||||
| 
 | ||||
|         // | ||||
|         // GET: /Manage/LinkLoginCallback | ||||
|         [HttpGet] | ||||
|         public async Task<ActionResult> LinkLoginCallback() | ||||
|         { | ||||
|             var user = await GetCurrentUserAsync(); | ||||
|             if (user == null) | ||||
|             { | ||||
|                 return View("Error"); | ||||
|             } | ||||
|             var info = await _signInManager.GetExternalLoginInfoAsync(await _userManager.GetUserIdAsync(user)); | ||||
|             if (info == null) | ||||
|             { | ||||
|                 return RedirectToAction(nameof(ManageLogins), new { Message = ManageMessageId.Error }); | ||||
|             } | ||||
|             var result = await _userManager.AddLoginAsync(user, info); | ||||
|             var message = result.Succeeded ? ManageMessageId.AddLoginSuccess : ManageMessageId.Error; | ||||
|             return RedirectToAction(nameof(ManageLogins), new { Message = message }); | ||||
|         } | ||||
| 
 | ||||
|         #region Helpers | ||||
| 
 | ||||
|         private void AddErrors(IdentityResult result) | ||||
|         { | ||||
|             foreach (var error in result.Errors) | ||||
|             { | ||||
|                 ModelState.AddModelError(string.Empty, error.Description); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         public enum ManageMessageId | ||||
|         { | ||||
|             AddPhoneSuccess, | ||||
|             AddLoginSuccess, | ||||
|             ChangePasswordSuccess, | ||||
|             SetTwoFactorSuccess, | ||||
|             SetPasswordSuccess, | ||||
|             RemoveLoginSuccess, | ||||
|             RemovePhoneSuccess, | ||||
|             Error | ||||
|         } | ||||
| 
 | ||||
|         private Task<ApplicationUser> GetCurrentUserAsync() | ||||
|         { | ||||
|             return _userManager.GetUserAsync(HttpContext.User); | ||||
|         } | ||||
| 
 | ||||
|         #endregion | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,26 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Identity.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.Containerized_eShop.WebMVC.Models; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Data | ||||
| { | ||||
|     public class ApplicationDbContext : IdentityDbContext<ApplicationUser> | ||||
|     { | ||||
|         public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) | ||||
|             : base(options) | ||||
|         { | ||||
|         } | ||||
| 
 | ||||
|         protected override void OnModelCreating(ModelBuilder builder) | ||||
|         { | ||||
|             base.OnModelCreating(builder); | ||||
|             // Customize the ASP.NET Identity model and override the defaults if needed. | ||||
|             // For example, you can rename the ASP.NET Identity table names and more. | ||||
|             // Add your customizations after calling base.OnModelCreating(builder); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,216 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Infrastructure; | ||||
| using Microsoft.EntityFrameworkCore.Metadata; | ||||
| using Microsoft.EntityFrameworkCore.Migrations; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Data.Migrations | ||||
| { | ||||
|     [DbContext(typeof(ApplicationDbContext))] | ||||
|     [Migration("00000000000000_CreateIdentitySchema")] | ||||
|     partial class CreateIdentitySchema | ||||
|     { | ||||
|         protected override void BuildTargetModel(ModelBuilder modelBuilder) | ||||
|         { | ||||
|             modelBuilder | ||||
|                 .HasAnnotation("ProductVersion", "1.0.0-rc3") | ||||
|                 .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => | ||||
|                 { | ||||
|                     b.Property<string>("Id"); | ||||
| 
 | ||||
|                     b.Property<string>("ConcurrencyStamp") | ||||
|                         .IsConcurrencyToken(); | ||||
| 
 | ||||
|                     b.Property<string>("Name") | ||||
|                         .HasAnnotation("MaxLength", 256); | ||||
| 
 | ||||
|                     b.Property<string>("NormalizedName") | ||||
|                         .HasAnnotation("MaxLength", 256); | ||||
| 
 | ||||
|                     b.HasKey("Id"); | ||||
| 
 | ||||
|                     b.HasIndex("NormalizedName") | ||||
|                         .HasName("RoleNameIndex"); | ||||
| 
 | ||||
|                     b.ToTable("AspNetRoles"); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b => | ||||
|                 { | ||||
|                     b.Property<int>("Id") | ||||
|                         .ValueGeneratedOnAdd(); | ||||
| 
 | ||||
|                     b.Property<string>("ClaimType"); | ||||
| 
 | ||||
|                     b.Property<string>("ClaimValue"); | ||||
| 
 | ||||
|                     b.Property<string>("RoleId") | ||||
|                         .IsRequired(); | ||||
| 
 | ||||
|                     b.HasKey("Id"); | ||||
| 
 | ||||
|                     b.HasIndex("RoleId"); | ||||
| 
 | ||||
|                     b.ToTable("AspNetRoleClaims"); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b => | ||||
|                 { | ||||
|                     b.Property<int>("Id") | ||||
|                         .ValueGeneratedOnAdd(); | ||||
| 
 | ||||
|                     b.Property<string>("ClaimType"); | ||||
| 
 | ||||
|                     b.Property<string>("ClaimValue"); | ||||
| 
 | ||||
|                     b.Property<string>("UserId") | ||||
|                         .IsRequired(); | ||||
| 
 | ||||
|                     b.HasKey("Id"); | ||||
| 
 | ||||
|                     b.HasIndex("UserId"); | ||||
| 
 | ||||
|                     b.ToTable("AspNetUserClaims"); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b => | ||||
|                 { | ||||
|                     b.Property<string>("LoginProvider"); | ||||
| 
 | ||||
|                     b.Property<string>("ProviderKey"); | ||||
| 
 | ||||
|                     b.Property<string>("ProviderDisplayName"); | ||||
| 
 | ||||
|                     b.Property<string>("UserId") | ||||
|                         .IsRequired(); | ||||
| 
 | ||||
|                     b.HasKey("LoginProvider", "ProviderKey"); | ||||
| 
 | ||||
|                     b.HasIndex("UserId"); | ||||
| 
 | ||||
|                     b.ToTable("AspNetUserLogins"); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b => | ||||
|                 { | ||||
|                     b.Property<string>("UserId"); | ||||
| 
 | ||||
|                     b.Property<string>("RoleId"); | ||||
| 
 | ||||
|                     b.HasKey("UserId", "RoleId"); | ||||
| 
 | ||||
|                     b.HasIndex("RoleId"); | ||||
| 
 | ||||
|                     b.HasIndex("UserId"); | ||||
| 
 | ||||
|                     b.ToTable("AspNetUserRoles"); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken<string>", b => | ||||
|                 { | ||||
|                     b.Property<string>("UserId"); | ||||
| 
 | ||||
|                     b.Property<string>("LoginProvider"); | ||||
| 
 | ||||
|                     b.Property<string>("Name"); | ||||
| 
 | ||||
|                     b.Property<string>("Value"); | ||||
| 
 | ||||
|                     b.HasKey("UserId", "LoginProvider", "Name"); | ||||
| 
 | ||||
|                     b.ToTable("AspNetUserTokens"); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.Containerized_eShop.WebMVC.Models.ApplicationUser", b => | ||||
|                 { | ||||
|                     b.Property<string>("Id"); | ||||
| 
 | ||||
|                     b.Property<int>("AccessFailedCount"); | ||||
| 
 | ||||
|                     b.Property<string>("ConcurrencyStamp") | ||||
|                         .IsConcurrencyToken(); | ||||
| 
 | ||||
|                     b.Property<string>("Email") | ||||
|                         .HasAnnotation("MaxLength", 256); | ||||
| 
 | ||||
|                     b.Property<bool>("EmailConfirmed"); | ||||
| 
 | ||||
|                     b.Property<bool>("LockoutEnabled"); | ||||
| 
 | ||||
|                     b.Property<DateTimeOffset?>("LockoutEnd"); | ||||
| 
 | ||||
|                     b.Property<string>("NormalizedEmail") | ||||
|                         .HasAnnotation("MaxLength", 256); | ||||
| 
 | ||||
|                     b.Property<string>("NormalizedUserName") | ||||
|                         .HasAnnotation("MaxLength", 256); | ||||
| 
 | ||||
|                     b.Property<string>("PasswordHash"); | ||||
| 
 | ||||
|                     b.Property<string>("PhoneNumber"); | ||||
| 
 | ||||
|                     b.Property<bool>("PhoneNumberConfirmed"); | ||||
| 
 | ||||
|                     b.Property<string>("SecurityStamp"); | ||||
| 
 | ||||
|                     b.Property<bool>("TwoFactorEnabled"); | ||||
| 
 | ||||
|                     b.Property<string>("UserName") | ||||
|                         .HasAnnotation("MaxLength", 256); | ||||
| 
 | ||||
|                     b.HasKey("Id"); | ||||
| 
 | ||||
|                     b.HasIndex("NormalizedEmail") | ||||
|                         .HasName("EmailIndex"); | ||||
| 
 | ||||
|                     b.HasIndex("NormalizedUserName") | ||||
|                         .IsUnique() | ||||
|                         .HasName("UserNameIndex"); | ||||
| 
 | ||||
|                     b.ToTable("AspNetUsers"); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b => | ||||
|                 { | ||||
|                     b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") | ||||
|                         .WithMany("Claims") | ||||
|                         .HasForeignKey("RoleId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b => | ||||
|                 { | ||||
|                     b.HasOne("Microsoft.Containerized_eShop.WebMVC.Models.ApplicationUser") | ||||
|                         .WithMany("Claims") | ||||
|                         .HasForeignKey("UserId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b => | ||||
|                 { | ||||
|                     b.HasOne("Microsoft.Containerized_eShop.WebMVC.Models.ApplicationUser") | ||||
|                         .WithMany("Logins") | ||||
|                         .HasForeignKey("UserId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b => | ||||
|                 { | ||||
|                     b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") | ||||
|                         .WithMany("Users") | ||||
|                         .HasForeignKey("RoleId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade); | ||||
| 
 | ||||
|                     b.HasOne("Microsoft.Containerized_eShop.WebMVC.Models.ApplicationUser") | ||||
|                         .WithMany("Roles") | ||||
|                         .HasForeignKey("UserId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade); | ||||
|                 }); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,219 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.EntityFrameworkCore.Metadata; | ||||
| using Microsoft.EntityFrameworkCore.Migrations; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Data.Migrations | ||||
| { | ||||
|     public partial class CreateIdentitySchema : Migration | ||||
|     { | ||||
|         protected override void Up(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "AspNetRoles", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     Id = table.Column<string>(nullable: false), | ||||
|                     ConcurrencyStamp = table.Column<string>(nullable: true), | ||||
|                     Name = table.Column<string>(maxLength: 256, nullable: true), | ||||
|                     NormalizedName = table.Column<string>(maxLength: 256, nullable: true) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_AspNetRoles", x => x.Id); | ||||
|                 }); | ||||
| 
 | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "AspNetUserTokens", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     UserId = table.Column<string>(nullable: false), | ||||
|                     LoginProvider = table.Column<string>(nullable: false), | ||||
|                     Name = table.Column<string>(nullable: false), | ||||
|                     Value = table.Column<string>(nullable: true) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); | ||||
|                 }); | ||||
| 
 | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "AspNetUsers", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     Id = table.Column<string>(nullable: false), | ||||
|                     AccessFailedCount = table.Column<int>(nullable: false), | ||||
|                     ConcurrencyStamp = table.Column<string>(nullable: true), | ||||
|                     Email = table.Column<string>(maxLength: 256, nullable: true), | ||||
|                     EmailConfirmed = table.Column<bool>(nullable: false), | ||||
|                     LockoutEnabled = table.Column<bool>(nullable: false), | ||||
|                     LockoutEnd = table.Column<DateTimeOffset>(nullable: true), | ||||
|                     NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true), | ||||
|                     NormalizedUserName = table.Column<string>(maxLength: 256, nullable: true), | ||||
|                     PasswordHash = table.Column<string>(nullable: true), | ||||
|                     PhoneNumber = table.Column<string>(nullable: true), | ||||
|                     PhoneNumberConfirmed = table.Column<bool>(nullable: false), | ||||
|                     SecurityStamp = table.Column<string>(nullable: true), | ||||
|                     TwoFactorEnabled = table.Column<bool>(nullable: false), | ||||
|                     UserName = table.Column<string>(maxLength: 256, nullable: true) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_AspNetUsers", x => x.Id); | ||||
|                 }); | ||||
| 
 | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "AspNetRoleClaims", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     Id = table.Column<int>(nullable: false) | ||||
|                         .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), | ||||
|                     ClaimType = table.Column<string>(nullable: true), | ||||
|                     ClaimValue = table.Column<string>(nullable: true), | ||||
|                     RoleId = table.Column<string>(nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); | ||||
|                     table.ForeignKey( | ||||
|                         name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", | ||||
|                         column: x => x.RoleId, | ||||
|                         principalTable: "AspNetRoles", | ||||
|                         principalColumn: "Id", | ||||
|                         onDelete: ReferentialAction.Cascade); | ||||
|                 }); | ||||
| 
 | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "AspNetUserClaims", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     Id = table.Column<int>(nullable: false) | ||||
|                         .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), | ||||
|                     ClaimType = table.Column<string>(nullable: true), | ||||
|                     ClaimValue = table.Column<string>(nullable: true), | ||||
|                     UserId = table.Column<string>(nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); | ||||
|                     table.ForeignKey( | ||||
|                         name: "FK_AspNetUserClaims_AspNetUsers_UserId", | ||||
|                         column: x => x.UserId, | ||||
|                         principalTable: "AspNetUsers", | ||||
|                         principalColumn: "Id", | ||||
|                         onDelete: ReferentialAction.Cascade); | ||||
|                 }); | ||||
| 
 | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "AspNetUserLogins", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     LoginProvider = table.Column<string>(nullable: false), | ||||
|                     ProviderKey = table.Column<string>(nullable: false), | ||||
|                     ProviderDisplayName = table.Column<string>(nullable: true), | ||||
|                     UserId = table.Column<string>(nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); | ||||
|                     table.ForeignKey( | ||||
|                         name: "FK_AspNetUserLogins_AspNetUsers_UserId", | ||||
|                         column: x => x.UserId, | ||||
|                         principalTable: "AspNetUsers", | ||||
|                         principalColumn: "Id", | ||||
|                         onDelete: ReferentialAction.Cascade); | ||||
|                 }); | ||||
| 
 | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "AspNetUserRoles", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     UserId = table.Column<string>(nullable: false), | ||||
|                     RoleId = table.Column<string>(nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); | ||||
|                     table.ForeignKey( | ||||
|                         name: "FK_AspNetUserRoles_AspNetRoles_RoleId", | ||||
|                         column: x => x.RoleId, | ||||
|                         principalTable: "AspNetRoles", | ||||
|                         principalColumn: "Id", | ||||
|                         onDelete: ReferentialAction.Cascade); | ||||
|                     table.ForeignKey( | ||||
|                         name: "FK_AspNetUserRoles_AspNetUsers_UserId", | ||||
|                         column: x => x.UserId, | ||||
|                         principalTable: "AspNetUsers", | ||||
|                         principalColumn: "Id", | ||||
|                         onDelete: ReferentialAction.Cascade); | ||||
|                 }); | ||||
| 
 | ||||
|             migrationBuilder.CreateIndex( | ||||
|                 name: "RoleNameIndex", | ||||
|                 table: "AspNetRoles", | ||||
|                 column: "NormalizedName"); | ||||
| 
 | ||||
|             migrationBuilder.CreateIndex( | ||||
|                 name: "IX_AspNetRoleClaims_RoleId", | ||||
|                 table: "AspNetRoleClaims", | ||||
|                 column: "RoleId"); | ||||
| 
 | ||||
|             migrationBuilder.CreateIndex( | ||||
|                 name: "IX_AspNetUserClaims_UserId", | ||||
|                 table: "AspNetUserClaims", | ||||
|                 column: "UserId"); | ||||
| 
 | ||||
|             migrationBuilder.CreateIndex( | ||||
|                 name: "IX_AspNetUserLogins_UserId", | ||||
|                 table: "AspNetUserLogins", | ||||
|                 column: "UserId"); | ||||
| 
 | ||||
|             migrationBuilder.CreateIndex( | ||||
|                 name: "IX_AspNetUserRoles_RoleId", | ||||
|                 table: "AspNetUserRoles", | ||||
|                 column: "RoleId"); | ||||
| 
 | ||||
|             migrationBuilder.CreateIndex( | ||||
|                 name: "IX_AspNetUserRoles_UserId", | ||||
|                 table: "AspNetUserRoles", | ||||
|                 column: "UserId"); | ||||
| 
 | ||||
|             migrationBuilder.CreateIndex( | ||||
|                 name: "EmailIndex", | ||||
|                 table: "AspNetUsers", | ||||
|                 column: "NormalizedEmail"); | ||||
| 
 | ||||
|             migrationBuilder.CreateIndex( | ||||
|                 name: "UserNameIndex", | ||||
|                 table: "AspNetUsers", | ||||
|                 column: "NormalizedUserName", | ||||
|                 unique: true); | ||||
|         } | ||||
| 
 | ||||
|         protected override void Down(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "AspNetRoleClaims"); | ||||
| 
 | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "AspNetUserClaims"); | ||||
| 
 | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "AspNetUserLogins"); | ||||
| 
 | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "AspNetUserRoles"); | ||||
| 
 | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "AspNetUserTokens"); | ||||
| 
 | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "AspNetRoles"); | ||||
| 
 | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "AspNetUsers"); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,215 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Infrastructure; | ||||
| using Microsoft.EntityFrameworkCore.Metadata; | ||||
| using Microsoft.EntityFrameworkCore.Migrations; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Data.Migrations | ||||
| { | ||||
|     [DbContext(typeof(ApplicationDbContext))] | ||||
|     partial class ApplicationDbContextModelSnapshot : ModelSnapshot | ||||
|     { | ||||
|         protected override void BuildModel(ModelBuilder modelBuilder) | ||||
|         { | ||||
|             modelBuilder | ||||
|                 .HasAnnotation("ProductVersion", "1.0.0-rc3") | ||||
|                 .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => | ||||
|                 { | ||||
|                     b.Property<string>("Id"); | ||||
| 
 | ||||
|                     b.Property<string>("ConcurrencyStamp") | ||||
|                         .IsConcurrencyToken(); | ||||
| 
 | ||||
|                     b.Property<string>("Name") | ||||
|                         .HasAnnotation("MaxLength", 256); | ||||
| 
 | ||||
|                     b.Property<string>("NormalizedName") | ||||
|                         .HasAnnotation("MaxLength", 256); | ||||
| 
 | ||||
|                     b.HasKey("Id"); | ||||
| 
 | ||||
|                     b.HasIndex("NormalizedName") | ||||
|                         .HasName("RoleNameIndex"); | ||||
| 
 | ||||
|                     b.ToTable("AspNetRoles"); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b => | ||||
|                 { | ||||
|                     b.Property<int>("Id") | ||||
|                         .ValueGeneratedOnAdd(); | ||||
| 
 | ||||
|                     b.Property<string>("ClaimType"); | ||||
| 
 | ||||
|                     b.Property<string>("ClaimValue"); | ||||
| 
 | ||||
|                     b.Property<string>("RoleId") | ||||
|                         .IsRequired(); | ||||
| 
 | ||||
|                     b.HasKey("Id"); | ||||
| 
 | ||||
|                     b.HasIndex("RoleId"); | ||||
| 
 | ||||
|                     b.ToTable("AspNetRoleClaims"); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b => | ||||
|                 { | ||||
|                     b.Property<int>("Id") | ||||
|                         .ValueGeneratedOnAdd(); | ||||
| 
 | ||||
|                     b.Property<string>("ClaimType"); | ||||
| 
 | ||||
|                     b.Property<string>("ClaimValue"); | ||||
| 
 | ||||
|                     b.Property<string>("UserId") | ||||
|                         .IsRequired(); | ||||
| 
 | ||||
|                     b.HasKey("Id"); | ||||
| 
 | ||||
|                     b.HasIndex("UserId"); | ||||
| 
 | ||||
|                     b.ToTable("AspNetUserClaims"); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b => | ||||
|                 { | ||||
|                     b.Property<string>("LoginProvider"); | ||||
| 
 | ||||
|                     b.Property<string>("ProviderKey"); | ||||
| 
 | ||||
|                     b.Property<string>("ProviderDisplayName"); | ||||
| 
 | ||||
|                     b.Property<string>("UserId") | ||||
|                         .IsRequired(); | ||||
| 
 | ||||
|                     b.HasKey("LoginProvider", "ProviderKey"); | ||||
| 
 | ||||
|                     b.HasIndex("UserId"); | ||||
| 
 | ||||
|                     b.ToTable("AspNetUserLogins"); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b => | ||||
|                 { | ||||
|                     b.Property<string>("UserId"); | ||||
| 
 | ||||
|                     b.Property<string>("RoleId"); | ||||
| 
 | ||||
|                     b.HasKey("UserId", "RoleId"); | ||||
| 
 | ||||
|                     b.HasIndex("RoleId"); | ||||
| 
 | ||||
|                     b.HasIndex("UserId"); | ||||
| 
 | ||||
|                     b.ToTable("AspNetUserRoles"); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken<string>", b => | ||||
|                 { | ||||
|                     b.Property<string>("UserId"); | ||||
| 
 | ||||
|                     b.Property<string>("LoginProvider"); | ||||
| 
 | ||||
|                     b.Property<string>("Name"); | ||||
| 
 | ||||
|                     b.Property<string>("Value"); | ||||
| 
 | ||||
|                     b.HasKey("UserId", "LoginProvider", "Name"); | ||||
| 
 | ||||
|                     b.ToTable("AspNetUserTokens"); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.Containerized_eShop.WebMVC.Models.ApplicationUser", b => | ||||
|                 { | ||||
|                     b.Property<string>("Id"); | ||||
| 
 | ||||
|                     b.Property<int>("AccessFailedCount"); | ||||
| 
 | ||||
|                     b.Property<string>("ConcurrencyStamp") | ||||
|                         .IsConcurrencyToken(); | ||||
| 
 | ||||
|                     b.Property<string>("Email") | ||||
|                         .HasAnnotation("MaxLength", 256); | ||||
| 
 | ||||
|                     b.Property<bool>("EmailConfirmed"); | ||||
| 
 | ||||
|                     b.Property<bool>("LockoutEnabled"); | ||||
| 
 | ||||
|                     b.Property<DateTimeOffset?>("LockoutEnd"); | ||||
| 
 | ||||
|                     b.Property<string>("NormalizedEmail") | ||||
|                         .HasAnnotation("MaxLength", 256); | ||||
| 
 | ||||
|                     b.Property<string>("NormalizedUserName") | ||||
|                         .HasAnnotation("MaxLength", 256); | ||||
| 
 | ||||
|                     b.Property<string>("PasswordHash"); | ||||
| 
 | ||||
|                     b.Property<string>("PhoneNumber"); | ||||
| 
 | ||||
|                     b.Property<bool>("PhoneNumberConfirmed"); | ||||
| 
 | ||||
|                     b.Property<string>("SecurityStamp"); | ||||
| 
 | ||||
|                     b.Property<bool>("TwoFactorEnabled"); | ||||
| 
 | ||||
|                     b.Property<string>("UserName") | ||||
|                         .HasAnnotation("MaxLength", 256); | ||||
| 
 | ||||
|                     b.HasKey("Id"); | ||||
| 
 | ||||
|                     b.HasIndex("NormalizedEmail") | ||||
|                         .HasName("EmailIndex"); | ||||
| 
 | ||||
|                     b.HasIndex("NormalizedUserName") | ||||
|                         .IsUnique() | ||||
|                         .HasName("UserNameIndex"); | ||||
| 
 | ||||
|                     b.ToTable("AspNetUsers"); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b => | ||||
|                 { | ||||
|                     b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") | ||||
|                         .WithMany("Claims") | ||||
|                         .HasForeignKey("RoleId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b => | ||||
|                 { | ||||
|                     b.HasOne("Microsoft.Containerized_eShop.WebMVC.Models.ApplicationUser") | ||||
|                         .WithMany("Claims") | ||||
|                         .HasForeignKey("UserId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b => | ||||
|                 { | ||||
|                     b.HasOne("Microsoft.Containerized_eShop.WebMVC.Models.ApplicationUser") | ||||
|                         .WithMany("Logins") | ||||
|                         .HasForeignKey("UserId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade); | ||||
|                 }); | ||||
| 
 | ||||
|             modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b => | ||||
|                 { | ||||
|                     b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") | ||||
|                         .WithMany("Users") | ||||
|                         .HasForeignKey("RoleId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade); | ||||
| 
 | ||||
|                     b.HasOne("Microsoft.Containerized_eShop.WebMVC.Models.ApplicationUser") | ||||
|                         .WithMany("Roles") | ||||
|                         .HasForeignKey("UserId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade); | ||||
|                 }); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,23 @@ | ||||
| <?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)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> | ||||
|   <PropertyGroup Label="Globals"> | ||||
|     <ProjectGuid>1d40c583-abf0-400b-8c63-2c3669268c8b</ProjectGuid> | ||||
|     <RootNamespace>Microsoft.Containerized_eShop.WebMVC</RootNamespace> | ||||
|     <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> | ||||
|     <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> | ||||
|     <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup> | ||||
|     <SchemaVersion>2.0</SchemaVersion> | ||||
|   </PropertyGroup> | ||||
|   <ItemGroup> | ||||
|     <DnxInvisibleContent Include="bower.json" /> | ||||
|     <DnxInvisibleContent Include=".bowerrc" /> | ||||
|   </ItemGroup> | ||||
|   <Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" /> | ||||
| </Project> | ||||
| @ -0,0 +1,15 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.AccountViewModels | ||||
| { | ||||
|     public class ExternalLoginConfirmationViewModel | ||||
|     { | ||||
|         [Required] | ||||
|         [EmailAddress] | ||||
|         public string Email { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,15 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.AccountViewModels | ||||
| { | ||||
|     public class ForgotPasswordViewModel | ||||
|     { | ||||
|         [Required] | ||||
|         [EmailAddress] | ||||
|         public string Email { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,22 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.AccountViewModels | ||||
| { | ||||
|     public class LoginViewModel | ||||
|     { | ||||
|         [Required] | ||||
|         [EmailAddress] | ||||
|         public string Email { get; set; } | ||||
| 
 | ||||
|         [Required] | ||||
|         [DataType(DataType.Password)] | ||||
|         public string Password { get; set; } | ||||
| 
 | ||||
|         [Display(Name = "Remember me?")] | ||||
|         public bool RememberMe { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,27 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.AccountViewModels | ||||
| { | ||||
|     public class RegisterViewModel | ||||
|     { | ||||
|         [Required] | ||||
|         [EmailAddress] | ||||
|         [Display(Name = "Email")] | ||||
|         public string Email { get; set; } | ||||
| 
 | ||||
|         [Required] | ||||
|         [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] | ||||
|         [DataType(DataType.Password)] | ||||
|         [Display(Name = "Password")] | ||||
|         public string Password { get; set; } | ||||
| 
 | ||||
|         [DataType(DataType.Password)] | ||||
|         [Display(Name = "Confirm password")] | ||||
|         [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] | ||||
|         public string ConfirmPassword { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,27 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.AccountViewModels | ||||
| { | ||||
|     public class ResetPasswordViewModel | ||||
|     { | ||||
|         [Required] | ||||
|         [EmailAddress] | ||||
|         public string Email { get; set; } | ||||
| 
 | ||||
|         [Required] | ||||
|         [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] | ||||
|         [DataType(DataType.Password)] | ||||
|         public string Password { get; set; } | ||||
| 
 | ||||
|         [DataType(DataType.Password)] | ||||
|         [Display(Name = "Confirm password")] | ||||
|         [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] | ||||
|         public string ConfirmPassword { get; set; } | ||||
| 
 | ||||
|         public string Code { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,19 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Mvc.Rendering; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.AccountViewModels | ||||
| { | ||||
|     public class SendCodeViewModel | ||||
|     { | ||||
|         public string SelectedProvider { get; set; } | ||||
| 
 | ||||
|         public ICollection<SelectListItem> Providers { get; set; } | ||||
| 
 | ||||
|         public string ReturnUrl { get; set; } | ||||
| 
 | ||||
|         public bool RememberMe { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,25 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.AccountViewModels | ||||
| { | ||||
|     public class VerifyCodeViewModel | ||||
|     { | ||||
|         [Required] | ||||
|         public string Provider { get; set; } | ||||
| 
 | ||||
|         [Required] | ||||
|         public string Code { get; set; } | ||||
| 
 | ||||
|         public string ReturnUrl { get; set; } | ||||
| 
 | ||||
|         [Display(Name = "Remember this browser?")] | ||||
|         public bool RememberBrowser { get; set; } | ||||
| 
 | ||||
|         [Display(Name = "Remember me?")] | ||||
|         public bool RememberMe { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,13 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Identity.EntityFrameworkCore; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models | ||||
| { | ||||
|     // Add profile data for application users by adding properties to the ApplicationUser class | ||||
|     public class ApplicationUser : IdentityUser | ||||
|     { | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,16 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.ManageViewModels | ||||
| { | ||||
|     public class AddPhoneNumberViewModel | ||||
|     { | ||||
|         [Required] | ||||
|         [Phone] | ||||
|         [Display(Name = "Phone number")] | ||||
|         public string PhoneNumber { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,27 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.ManageViewModels | ||||
| { | ||||
|     public class ChangePasswordViewModel | ||||
|     { | ||||
|         [Required] | ||||
|         [DataType(DataType.Password)] | ||||
|         [Display(Name = "Current password")] | ||||
|         public string OldPassword { get; set; } | ||||
| 
 | ||||
|         [Required] | ||||
|         [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] | ||||
|         [DataType(DataType.Password)] | ||||
|         [Display(Name = "New password")] | ||||
|         public string NewPassword { get; set; } | ||||
| 
 | ||||
|         [DataType(DataType.Password)] | ||||
|         [Display(Name = "Confirm new password")] | ||||
|         [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] | ||||
|         public string ConfirmPassword { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,15 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Mvc.Rendering; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.ManageViewModels | ||||
| { | ||||
|     public class ConfigureTwoFactorViewModel | ||||
|     { | ||||
|         public string SelectedProvider { get; set; } | ||||
| 
 | ||||
|         public ICollection<SelectListItem> Providers { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,12 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.ManageViewModels | ||||
| { | ||||
|     public class FactorViewModel | ||||
|     { | ||||
|         public string Purpose { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,21 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Identity; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.ManageViewModels | ||||
| { | ||||
|     public class IndexViewModel | ||||
|     { | ||||
|         public bool HasPassword { get; set; } | ||||
| 
 | ||||
|         public IList<UserLoginInfo> Logins { get; set; } | ||||
| 
 | ||||
|         public string PhoneNumber { get; set; } | ||||
| 
 | ||||
|         public bool TwoFactor { get; set; } | ||||
| 
 | ||||
|         public bool BrowserRemembered { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,16 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Http.Authentication; | ||||
| using Microsoft.AspNetCore.Identity; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.ManageViewModels | ||||
| { | ||||
|     public class ManageLoginsViewModel | ||||
|     { | ||||
|         public IList<UserLoginInfo> CurrentLogins { get; set; } | ||||
| 
 | ||||
|         public IList<AuthenticationDescription> OtherLogins { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,14 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.ManageViewModels | ||||
| { | ||||
|     public class RemoveLoginViewModel | ||||
|     { | ||||
|         public string LoginProvider { get; set; } | ||||
|         public string ProviderKey { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,22 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.ManageViewModels | ||||
| { | ||||
|     public class SetPasswordViewModel | ||||
|     { | ||||
|         [Required] | ||||
|         [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] | ||||
|         [DataType(DataType.Password)] | ||||
|         [Display(Name = "New password")] | ||||
|         public string NewPassword { get; set; } | ||||
| 
 | ||||
|         [DataType(DataType.Password)] | ||||
|         [Display(Name = "Confirm new password")] | ||||
|         [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] | ||||
|         public string ConfirmPassword { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,19 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Models.ManageViewModels | ||||
| { | ||||
|     public class VerifyPhoneNumberViewModel | ||||
|     { | ||||
|         [Required] | ||||
|         public string Code { get; set; } | ||||
| 
 | ||||
|         [Required] | ||||
|         [Phone] | ||||
|         [Display(Name = "Phone number")] | ||||
|         public string PhoneNumber { get; set; } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										24
									
								
								src/Web/Microsoft.Containerized-eShop.WebMVC/Program.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								src/Web/Microsoft.Containerized-eShop.WebMVC/Program.cs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,24 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.IO; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Hosting; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC | ||||
| { | ||||
|     public class Program | ||||
|     { | ||||
|         public static void Main(string[] args) | ||||
|         { | ||||
|             var host = new WebHostBuilder() | ||||
|                 .UseKestrel() | ||||
|                 .UseContentRoot(Directory.GetCurrentDirectory()) | ||||
|                 .UseIISIntegration() | ||||
|                 .UseStartup<Startup>() | ||||
|                 .Build(); | ||||
| 
 | ||||
|             host.Run(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										187
									
								
								src/Web/Microsoft.Containerized-eShop.WebMVC/Project_Readme.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										187
									
								
								src/Web/Microsoft.Containerized-eShop.WebMVC/Project_Readme.html
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,187 @@ | ||||
| <!DOCTYPE html> | ||||
| <html lang="en"> | ||||
| <head> | ||||
|     <meta charset="utf-8" /> | ||||
|     <title>Welcome to ASP.NET Core</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 Core</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. | ||||
|         </span> | ||||
|         <p>You've created a new ASP.NET Core 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 Core MVC</li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=518004">Bower</a> for managing client-side libraries</li> | ||||
|                 <li>Theming using <a href="http://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li> | ||||
|             </ul> | ||||
|         </div> | ||||
|         <div class="section"> | ||||
|             <h2>How to</h2> | ||||
|             <ul> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699562">Add an appsetting in config and access it in app.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699318">Add client packages using Bower.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li> | ||||
|             </ul> | ||||
|         </div> | ||||
|         <div class="section"> | ||||
|             <h2>Overview</h2> | ||||
|             <ul> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li> | ||||
|             </ul> | ||||
|         </div> | ||||
|         <div class="section last"> | ||||
|             <h2>Run & Deploy</h2> | ||||
|             <ul> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li> | ||||
|                 <li><a href="http://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</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> | ||||
| @ -0,0 +1,27 @@ | ||||
| { | ||||
|   "iisSettings": { | ||||
|     "windowsAuthentication": false, | ||||
|     "anonymousAuthentication": true, | ||||
|     "iisExpress": { | ||||
|       "applicationUrl": "http://localhost:2795/", | ||||
|       "sslPort": 0 | ||||
|     } | ||||
|   }, | ||||
|   "profiles": { | ||||
|     "IIS Express": { | ||||
|       "commandName": "IISExpress", | ||||
|       "launchBrowser": true, | ||||
|       "environmentVariables": { | ||||
|         "ASPNETCORE_ENVIRONMENT": "Development" | ||||
|       } | ||||
|     }, | ||||
|     "Microsoft.Containerized_eShop.WebMVC": { | ||||
|       "commandName": "Project", | ||||
|       "launchBrowser": true, | ||||
|       "launchUrl": "http://localhost:5000", | ||||
|       "environmentVariables": { | ||||
|         "ASPNETCORE_ENVIRONMENT": "Development" | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,12 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Services | ||||
| { | ||||
|     public interface IEmailSender | ||||
|     { | ||||
|         Task SendEmailAsync(string email, string subject, string message); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,12 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Services | ||||
| { | ||||
|     public interface ISmsSender | ||||
|     { | ||||
|         Task SendSmsAsync(string number, string message); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,25 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC.Services | ||||
| { | ||||
|     // This class is used by the application to send Email and SMS | ||||
|     // when you turn on two-factor authentication in ASP.NET Identity. | ||||
|     // For more details see this link http://go.microsoft.com/fwlink/?LinkID=532713 | ||||
|     public class AuthMessageSender : IEmailSender, ISmsSender | ||||
|     { | ||||
|         public Task SendEmailAsync(string email, string subject, string message) | ||||
|         { | ||||
|             // Plug in your email service here to send an email. | ||||
|             return Task.FromResult(0); | ||||
|         } | ||||
| 
 | ||||
|         public Task SendSmsAsync(string number, string message) | ||||
|         { | ||||
|             // Plug in your SMS service here to send a text message. | ||||
|             return Task.FromResult(0); | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										88
									
								
								src/Web/Microsoft.Containerized-eShop.WebMVC/Startup.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								src/Web/Microsoft.Containerized-eShop.WebMVC/Startup.cs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,88 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Builder; | ||||
| using Microsoft.AspNetCore.Hosting; | ||||
| using Microsoft.AspNetCore.Identity.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.Extensions.Configuration; | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using Microsoft.Extensions.Logging; | ||||
| using Microsoft.Containerized_eShop.WebMVC.Data; | ||||
| using Microsoft.Containerized_eShop.WebMVC.Models; | ||||
| using Microsoft.Containerized_eShop.WebMVC.Services; | ||||
| 
 | ||||
| namespace Microsoft.Containerized_eShop.WebMVC | ||||
| { | ||||
|     public class Startup | ||||
|     { | ||||
|         public Startup(IHostingEnvironment env) | ||||
|         { | ||||
|             var builder = new ConfigurationBuilder() | ||||
|                 .SetBasePath(env.ContentRootPath) | ||||
|                 .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) | ||||
|                 .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true); | ||||
| 
 | ||||
|             if (env.IsDevelopment()) | ||||
|             { | ||||
|                 // For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709 | ||||
|                 builder.AddUserSecrets(); | ||||
|             } | ||||
| 
 | ||||
|             builder.AddEnvironmentVariables(); | ||||
|             Configuration = builder.Build(); | ||||
|         } | ||||
| 
 | ||||
|         public IConfigurationRoot Configuration { get; } | ||||
| 
 | ||||
|         // This method gets called by the runtime. Use this method to add services to the container. | ||||
|         public void ConfigureServices(IServiceCollection services) | ||||
|         { | ||||
|             // Add framework services. | ||||
|             services.AddDbContext<ApplicationDbContext>(options => | ||||
|                 options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); | ||||
| 
 | ||||
|             services.AddIdentity<ApplicationUser, IdentityRole>() | ||||
|                 .AddEntityFrameworkStores<ApplicationDbContext>() | ||||
|                 .AddDefaultTokenProviders(); | ||||
| 
 | ||||
|             services.AddMvc(); | ||||
| 
 | ||||
|             // Add application services. | ||||
|             services.AddTransient<IEmailSender, AuthMessageSender>(); | ||||
|             services.AddTransient<ISmsSender, AuthMessageSender>(); | ||||
|         } | ||||
| 
 | ||||
|         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | ||||
|         public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) | ||||
|         { | ||||
|             loggerFactory.AddConsole(Configuration.GetSection("Logging")); | ||||
|             loggerFactory.AddDebug(); | ||||
| 
 | ||||
|             if (env.IsDevelopment()) | ||||
|             { | ||||
|                 app.UseDeveloperExceptionPage(); | ||||
|                 app.UseDatabaseErrorPage(); | ||||
|                 app.UseBrowserLink(); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 app.UseExceptionHandler("/Home/Error"); | ||||
|             } | ||||
| 
 | ||||
|             app.UseStaticFiles(); | ||||
| 
 | ||||
|             app.UseIdentity(); | ||||
| 
 | ||||
|             // Add external authentication middleware below. To configure them please see http://go.microsoft.com/fwlink/?LinkID=532715 | ||||
| 
 | ||||
|             app.UseMvc(routes => | ||||
|             { | ||||
|                 routes.MapRoute( | ||||
|                     name: "default", | ||||
|                     template: "{controller=Home}/{action=Index}/{id?}"); | ||||
|             }); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,10 @@ | ||||
| @{ | ||||
|     ViewData["Title"] = "Confirm Email"; | ||||
| } | ||||
| 
 | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| <div> | ||||
|     <p> | ||||
|         Thank you for confirming your email. Please <a asp-controller="Account" asp-action="Login">Click here to Log in</a>. | ||||
|     </p> | ||||
| </div> | ||||
| @ -0,0 +1,35 @@ | ||||
| @model ExternalLoginConfirmationViewModel | ||||
| @{ | ||||
|     ViewData["Title"] = "Register"; | ||||
| } | ||||
| 
 | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| <h3>Associate your @ViewData["LoginProvider"] account.</h3> | ||||
| 
 | ||||
| <form asp-controller="Account" asp-action="ExternalLoginConfirmation" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal"> | ||||
|     <h4>Association Form</h4> | ||||
|     <hr /> | ||||
|     <div asp-validation-summary="All" class="text-danger"></div> | ||||
| 
 | ||||
|     <p class="text-info"> | ||||
|         You've successfully authenticated with <strong>@ViewData["LoginProvider"]</strong>. | ||||
|         Please enter an email address for this site below and click the Register button to finish | ||||
|         logging in. | ||||
|     </p> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="Email" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="Email" class="form-control" /> | ||||
|             <span asp-validation-for="Email" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <div class="col-md-offset-2 col-md-10"> | ||||
|             <button type="submit" class="btn btn-default">Register</button> | ||||
|         </div> | ||||
|     </div> | ||||
| </form> | ||||
| 
 | ||||
| @section Scripts { | ||||
|     @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } | ||||
| } | ||||
| @ -0,0 +1,8 @@ | ||||
| @{ | ||||
|     ViewData["Title"] = "Login Failure"; | ||||
| } | ||||
| 
 | ||||
| <header> | ||||
|     <h2>@ViewData["Title"].</h2> | ||||
|     <p class="text-danger">Unsuccessful login with service.</p> | ||||
| </header> | ||||
| @ -0,0 +1,31 @@ | ||||
| @model ForgotPasswordViewModel | ||||
| @{ | ||||
|     ViewData["Title"] = "Forgot your password?"; | ||||
| } | ||||
| 
 | ||||
| <h2>@ViewData["Title"]</h2> | ||||
| <p> | ||||
|     For more information on how to enable reset password please see this <a href="http://go.microsoft.com/fwlink/?LinkID=532713">article</a>. | ||||
| </p> | ||||
| 
 | ||||
| @*<form asp-controller="Account" asp-action="ForgotPassword" method="post" class="form-horizontal"> | ||||
|     <h4>Enter your email.</h4> | ||||
|     <hr /> | ||||
|     <div asp-validation-summary="All" class="text-danger"></div> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="Email" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="Email" class="form-control" /> | ||||
|             <span asp-validation-for="Email" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <div class="col-md-offset-2 col-md-10"> | ||||
|             <button type="submit" class="btn btn-default">Submit</button> | ||||
|         </div> | ||||
|     </div> | ||||
| </form>*@ | ||||
| 
 | ||||
| @section Scripts { | ||||
|     @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } | ||||
| } | ||||
| @ -0,0 +1,8 @@ | ||||
| @{ | ||||
|     ViewData["Title"] = "Forgot Password Confirmation"; | ||||
| } | ||||
| 
 | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| <p> | ||||
|     Please check your email to reset your password. | ||||
| </p> | ||||
| @ -0,0 +1,8 @@ | ||||
| @{ | ||||
|     ViewData["Title"] = "Locked out"; | ||||
| } | ||||
| 
 | ||||
| <header> | ||||
|     <h1 class="text-danger">Locked out.</h1> | ||||
|     <p class="text-danger">This account has been locked out, please try again later.</p> | ||||
| </header> | ||||
| @ -0,0 +1,92 @@ | ||||
| @using System.Collections.Generic | ||||
| @using Microsoft.AspNetCore.Http | ||||
| @using Microsoft.AspNetCore.Http.Authentication | ||||
| @model LoginViewModel | ||||
| @inject SignInManager<ApplicationUser> SignInManager | ||||
| 
 | ||||
| @{ | ||||
|     ViewData["Title"] = "Log in"; | ||||
| } | ||||
| 
 | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| <div class="row"> | ||||
|     <div class="col-md-8"> | ||||
|         <section> | ||||
|             <form asp-controller="Account" asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal"> | ||||
|                 <h4>Use a local account to log in.</h4> | ||||
|                 <hr /> | ||||
|                 <div asp-validation-summary="All" class="text-danger"></div> | ||||
|                 <div class="form-group"> | ||||
|                     <label asp-for="Email" class="col-md-2 control-label"></label> | ||||
|                     <div class="col-md-10"> | ||||
|                         <input asp-for="Email" class="form-control" /> | ||||
|                         <span asp-validation-for="Email" class="text-danger"></span> | ||||
|                     </div> | ||||
|                 </div> | ||||
|                 <div class="form-group"> | ||||
|                     <label asp-for="Password" class="col-md-2 control-label"></label> | ||||
|                     <div class="col-md-10"> | ||||
|                         <input asp-for="Password" class="form-control" /> | ||||
|                         <span asp-validation-for="Password" class="text-danger"></span> | ||||
|                     </div> | ||||
|                 </div> | ||||
|                 <div class="form-group"> | ||||
|                     <div class="col-md-offset-2 col-md-10"> | ||||
|                         <div class="checkbox"> | ||||
|                             <label asp-for="RememberMe"> | ||||
|                                 <input asp-for="RememberMe" /> | ||||
|                                 @Html.DisplayNameFor(m => m.RememberMe) | ||||
|                             </label> | ||||
|                         </div> | ||||
|                     </div> | ||||
|                 </div> | ||||
|                 <div class="form-group"> | ||||
|                     <div class="col-md-offset-2 col-md-10"> | ||||
|                         <button type="submit" class="btn btn-default">Log in</button> | ||||
|                     </div> | ||||
|                 </div> | ||||
|                 <p> | ||||
|                     <a asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]">Register as a new user?</a> | ||||
|                 </p> | ||||
|                 <p> | ||||
|                     <a asp-action="ForgotPassword">Forgot your password?</a> | ||||
|                 </p> | ||||
|             </form> | ||||
|         </section> | ||||
|     </div> | ||||
|     <div class="col-md-4"> | ||||
|         <section> | ||||
|             <h4>Use another service to log in.</h4> | ||||
|             <hr /> | ||||
|             @{ | ||||
|                 var loginProviders = SignInManager.GetExternalAuthenticationSchemes().ToList(); | ||||
|                 if (loginProviders.Count == 0) | ||||
|                 { | ||||
|                     <div> | ||||
|                         <p> | ||||
|                             There are no external authentication services configured. See <a href="http://go.microsoft.com/fwlink/?LinkID=532715">this article</a> | ||||
|                             for details on setting up this ASP.NET application to support logging in via external services. | ||||
|                         </p> | ||||
|                     </div> | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     <form asp-controller="Account" asp-action="ExternalLogin" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal"> | ||||
|                         <div> | ||||
|                             <p> | ||||
|                                 @foreach (var provider in loginProviders) | ||||
|                                 { | ||||
|                                     <button type="submit" class="btn btn-default" name="provider" value="@provider.AuthenticationScheme" title="Log in using your @provider.DisplayName account">@provider.AuthenticationScheme</button> | ||||
|                                 } | ||||
|                             </p> | ||||
|                         </div> | ||||
|                     </form> | ||||
|                 } | ||||
|             } | ||||
|         </section> | ||||
|     </div> | ||||
| </div> | ||||
| 
 | ||||
| @section Scripts { | ||||
|     @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } | ||||
| } | ||||
| @ -0,0 +1,42 @@ | ||||
| @model RegisterViewModel | ||||
| @{ | ||||
|     ViewData["Title"] = "Register"; | ||||
| } | ||||
| 
 | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| 
 | ||||
| <form asp-controller="Account" asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal"> | ||||
|     <h4>Create a new account.</h4> | ||||
|     <hr /> | ||||
|     <div asp-validation-summary="All" class="text-danger"></div> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="Email" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="Email" class="form-control" /> | ||||
|             <span asp-validation-for="Email" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="Password" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="Password" class="form-control" /> | ||||
|             <span asp-validation-for="Password" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="ConfirmPassword" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="ConfirmPassword" class="form-control" /> | ||||
|             <span asp-validation-for="ConfirmPassword" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <div class="col-md-offset-2 col-md-10"> | ||||
|             <button type="submit" class="btn btn-default">Register</button> | ||||
|         </div> | ||||
|     </div> | ||||
| </form> | ||||
| 
 | ||||
| @section Scripts { | ||||
|     @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } | ||||
| } | ||||
| @ -0,0 +1,43 @@ | ||||
| @model ResetPasswordViewModel | ||||
| @{ | ||||
|     ViewData["Title"] = "Reset password"; | ||||
| } | ||||
| 
 | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| 
 | ||||
| <form asp-controller="Account" asp-action="ResetPassword" method="post" class="form-horizontal"> | ||||
|     <h4>Reset your password.</h4> | ||||
|     <hr /> | ||||
|     <div asp-validation-summary="All" class="text-danger"></div> | ||||
|     <input asp-for="Code" type="hidden" /> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="Email" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="Email" class="form-control" /> | ||||
|             <span asp-validation-for="Email" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="Password" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="Password" class="form-control" /> | ||||
|             <span asp-validation-for="Password" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="ConfirmPassword" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="ConfirmPassword" class="form-control" /> | ||||
|             <span asp-validation-for="ConfirmPassword" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <div class="col-md-offset-2 col-md-10"> | ||||
|             <button type="submit" class="btn btn-default">Reset</button> | ||||
|         </div> | ||||
|     </div> | ||||
| </form> | ||||
| 
 | ||||
| @section Scripts { | ||||
|     @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } | ||||
| } | ||||
| @ -0,0 +1,8 @@ | ||||
| @{ | ||||
|     ViewData["Title"] = "Reset password confirmation"; | ||||
| } | ||||
| 
 | ||||
| <h1>@ViewData["Title"].</h1> | ||||
| <p> | ||||
|     Your password has been reset. Please <a asp-controller="Account" asp-action="Login">Click here to log in</a>. | ||||
| </p> | ||||
| @ -0,0 +1,21 @@ | ||||
| @model SendCodeViewModel | ||||
| @{ | ||||
|     ViewData["Title"] = "Send Verification Code"; | ||||
| } | ||||
| 
 | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| 
 | ||||
| <form asp-controller="Account" asp-action="SendCode" asp-route-returnurl="@Model.ReturnUrl" method="post" class="form-horizontal"> | ||||
|     <input asp-for="RememberMe" type="hidden" /> | ||||
|     <div class="row"> | ||||
|         <div class="col-md-8"> | ||||
|             Select Two-Factor Authentication Provider: | ||||
|             <select asp-for="SelectedProvider" asp-items="Model.Providers"></select> | ||||
|             <button type="submit" class="btn btn-default">Submit</button> | ||||
|         </div> | ||||
|     </div> | ||||
| </form> | ||||
| 
 | ||||
| @section Scripts { | ||||
|     @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); } | ||||
| } | ||||
| @ -0,0 +1,38 @@ | ||||
| @model VerifyCodeViewModel | ||||
| @{ | ||||
|     ViewData["Title"] = "Verify"; | ||||
| } | ||||
| 
 | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| 
 | ||||
| <form asp-controller="Account" asp-action="VerifyCode" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal"> | ||||
|     <div asp-validation-summary="All" class="text-danger"></div> | ||||
|     <input asp-for="Provider" type="hidden" /> | ||||
|     <input asp-for="RememberMe" type="hidden" /> | ||||
|     <h4>@ViewData["Status"]</h4> | ||||
|     <hr /> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="Code" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="Code" class="form-control" /> | ||||
|             <span asp-validation-for="Code" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <div class="col-md-offset-2 col-md-10"> | ||||
|             <div class="checkbox"> | ||||
|                 <input asp-for="RememberBrowser" /> | ||||
|                 <label asp-for="RememberBrowser"></label> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <div class="col-md-offset-2 col-md-10"> | ||||
|             <button type="submit" class="btn btn-default">Submit</button> | ||||
|         </div> | ||||
|     </div> | ||||
| </form> | ||||
| 
 | ||||
| @section Scripts { | ||||
|     @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } | ||||
| } | ||||
| @ -0,0 +1,7 @@ | ||||
| @{ | ||||
|     ViewData["Title"] = "About"; | ||||
| } | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| <h3>@ViewData["Message"]</h3> | ||||
| 
 | ||||
| <p>Use this area to provide additional information.</p> | ||||
| @ -0,0 +1,17 @@ | ||||
| @{ | ||||
|     ViewData["Title"] = "Contact"; | ||||
| } | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| <h3>@ViewData["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:Support@example.com">Support@example.com</a><br /> | ||||
|     <strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a> | ||||
| </address> | ||||
| @ -0,0 +1,109 @@ | ||||
| @{ | ||||
|     ViewData["Title"] = "Home Page"; | ||||
| } | ||||
| 
 | ||||
| <div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000"> | ||||
|     <ol class="carousel-indicators"> | ||||
|         <li data-target="#myCarousel" data-slide-to="0" class="active"></li> | ||||
|         <li data-target="#myCarousel" data-slide-to="1"></li> | ||||
|         <li data-target="#myCarousel" data-slide-to="2"></li> | ||||
|         <li data-target="#myCarousel" data-slide-to="3"></li> | ||||
|     </ol> | ||||
|     <div class="carousel-inner" role="listbox"> | ||||
|         <div class="item active"> | ||||
|             <img src="~/images/banner1.svg" alt="ASP.NET" class="img-responsive" /> | ||||
|             <div class="carousel-caption" role="option"> | ||||
|                 <p> | ||||
|                     Learn how to build ASP.NET apps that can run anywhere. | ||||
|                     <a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkID=525028&clcid=0x409"> | ||||
|                         Learn More | ||||
|                     </a> | ||||
|                 </p> | ||||
|             </div> | ||||
|         </div> | ||||
|         <div class="item"> | ||||
|             <img src="~/images/banner2.svg" alt="Visual Studio" class="img-responsive" /> | ||||
|             <div class="carousel-caption" role="option"> | ||||
|                 <p> | ||||
|                     There are powerful new features in Visual Studio for building modern web apps. | ||||
|                     <a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkID=525030&clcid=0x409"> | ||||
|                         Learn More | ||||
|                     </a> | ||||
|                 </p> | ||||
|             </div> | ||||
|         </div> | ||||
|         <div class="item"> | ||||
|             <img src="~/images/banner3.svg" alt="Package Management" class="img-responsive" /> | ||||
|             <div class="carousel-caption" role="option"> | ||||
|                 <p> | ||||
|                     Bring in libraries from NuGet, Bower, and npm, and automate tasks using Grunt or Gulp. | ||||
|                     <a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkID=525029&clcid=0x409"> | ||||
|                         Learn More | ||||
|                     </a> | ||||
|                 </p> | ||||
|             </div> | ||||
|         </div> | ||||
|         <div class="item"> | ||||
|             <img src="~/images/banner4.svg" alt="Microsoft Azure" class="img-responsive" /> | ||||
|             <div class="carousel-caption" role="option"> | ||||
|                 <p> | ||||
|                     Learn how Microsoft's Azure cloud platform allows you to build, deploy, and scale web apps. | ||||
|                     <a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkID=525027&clcid=0x409"> | ||||
|                         Learn More | ||||
|                     </a> | ||||
|                 </p> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
|     <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"> | ||||
|         <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> | ||||
|         <span class="sr-only">Previous</span> | ||||
|     </a> | ||||
|     <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"> | ||||
|         <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> | ||||
|         <span class="sr-only">Next</span> | ||||
|     </a> | ||||
| </div> | ||||
| 
 | ||||
| <div class="row"> | ||||
|     <div class="col-md-3"> | ||||
|         <h2>Application uses</h2> | ||||
|         <ul> | ||||
|             <li>Sample pages using ASP.NET Core MVC</li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkId=518004">Bower</a> for managing client-side libraries</li> | ||||
|             <li>Theming using <a href="http://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li> | ||||
|         </ul> | ||||
|     </div> | ||||
|     <div class="col-md-3"> | ||||
|         <h2>How to</h2> | ||||
|         <ul> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkID=699562">Add an appsetting in config and access it in app.</a></li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkId=699318">Add client packages using Bower.</a></li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li> | ||||
|         </ul> | ||||
|     </div> | ||||
|     <div class="col-md-3"> | ||||
|         <h2>Overview</h2> | ||||
|         <ul> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li> | ||||
|         </ul> | ||||
|     </div> | ||||
|     <div class="col-md-3"> | ||||
|         <h2>Run & Deploy</h2> | ||||
|         <ul> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li> | ||||
|             <li><a href="http://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</a></li> | ||||
|         </ul> | ||||
|     </div> | ||||
| </div> | ||||
| @ -0,0 +1,27 @@ | ||||
| @model AddPhoneNumberViewModel | ||||
| @{ | ||||
|     ViewData["Title"] = "Add Phone Number"; | ||||
| } | ||||
| 
 | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| <form asp-controller="Manage" asp-action="AddPhoneNumber" method="post" class="form-horizontal"> | ||||
|     <h4>Add a phone number.</h4> | ||||
|     <hr /> | ||||
|     <div asp-validation-summary="All" class="text-danger"></div> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="PhoneNumber" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="PhoneNumber" class="form-control" /> | ||||
|             <span asp-validation-for="PhoneNumber" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <div class="col-md-offset-2 col-md-10"> | ||||
|             <button type="submit" class="btn btn-default">Send verification code</button> | ||||
|         </div> | ||||
|     </div> | ||||
| </form> | ||||
| 
 | ||||
| @section Scripts { | ||||
|     @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } | ||||
| } | ||||
| @ -0,0 +1,42 @@ | ||||
| @model ChangePasswordViewModel | ||||
| @{ | ||||
|     ViewData["Title"] = "Change Password"; | ||||
| } | ||||
| 
 | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| 
 | ||||
| <form asp-controller="Manage" asp-action="ChangePassword" method="post" class="form-horizontal"> | ||||
|     <h4>Change Password Form</h4> | ||||
|     <hr /> | ||||
|     <div asp-validation-summary="All" class="text-danger"></div> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="OldPassword" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="OldPassword" class="form-control" /> | ||||
|             <span asp-validation-for="OldPassword" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="NewPassword" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="NewPassword" class="form-control" /> | ||||
|             <span asp-validation-for="NewPassword" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="ConfirmPassword" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="ConfirmPassword" class="form-control" /> | ||||
|             <span asp-validation-for="ConfirmPassword" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <div class="col-md-offset-2 col-md-10"> | ||||
|             <button type="submit" class="btn btn-default">Change password</button> | ||||
|         </div> | ||||
|     </div> | ||||
| </form> | ||||
| 
 | ||||
| @section Scripts { | ||||
|     @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } | ||||
| } | ||||
| @ -0,0 +1,71 @@ | ||||
| @model IndexViewModel | ||||
| @{ | ||||
|     ViewData["Title"] = "Manage your account"; | ||||
| } | ||||
| 
 | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| <p class="text-success">@ViewData["StatusMessage"]</p> | ||||
| 
 | ||||
| <div> | ||||
|     <h4>Change your account settings</h4> | ||||
|     <hr /> | ||||
|     <dl class="dl-horizontal"> | ||||
|         <dt>Password:</dt> | ||||
|         <dd> | ||||
|             @if (Model.HasPassword) | ||||
|             { | ||||
|                 <a asp-controller="Manage" asp-action="ChangePassword" class="btn-bracketed">Change</a> | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 <a asp-controller="Manage" asp-action="SetPassword" class="btn-bracketed">Create</a> | ||||
|             } | ||||
|         </dd> | ||||
|         <dt>External Logins:</dt> | ||||
|         <dd> | ||||
| 
 | ||||
|             @Model.Logins.Count <a asp-controller="Manage" asp-action="ManageLogins" class="btn-bracketed">Manage</a> | ||||
|         </dd> | ||||
|         <dt>Phone Number:</dt> | ||||
|         <dd> | ||||
|             <p> | ||||
|                 Phone Numbers can used as a second factor of verification in two-factor authentication. | ||||
|                 See <a href="http://go.microsoft.com/fwlink/?LinkID=532713">this article</a> | ||||
|                 for details on setting up this ASP.NET application to support two-factor authentication using SMS. | ||||
|             </p> | ||||
|             @*@(Model.PhoneNumber ?? "None") | ||||
|                 @if (Model.PhoneNumber != null) | ||||
|                 { | ||||
|                     <br /> | ||||
|                     <a asp-controller="Manage" asp-action="AddPhoneNumber" class="btn-bracketed">Change</a> | ||||
|                     <form asp-controller="Manage" asp-action="RemovePhoneNumber" method="post"> | ||||
|                         [<button type="submit" class="btn-link">Remove</button>] | ||||
|                     </form> | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     <a asp-controller="Manage" asp-action="AddPhoneNumber" class="btn-bracketed">Add</a> | ||||
|                 }*@ | ||||
|         </dd> | ||||
| 
 | ||||
|         <dt>Two-Factor Authentication:</dt> | ||||
|         <dd> | ||||
|             <p> | ||||
|                 There are no two-factor authentication providers configured. See <a href="http://go.microsoft.com/fwlink/?LinkID=532713">this article</a> | ||||
|                 for setting up this application to support two-factor authentication. | ||||
|             </p> | ||||
|             @*@if (Model.TwoFactor) | ||||
|                 { | ||||
|                     <form asp-controller="Manage" asp-action="DisableTwoFactorAuthentication" method="post" class="form-horizontal"> | ||||
|                         Enabled <button type="submit" class="btn-link btn-bracketed">Disable</button> | ||||
|                     </form> | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     <form asp-controller="Manage" asp-action="EnableTwoFactorAuthentication" method="post" class="form-horizontal"> | ||||
|                         <button type="submit" class="btn-link btn-bracketed">Enable</button> Disabled | ||||
|                     </form> | ||||
|                 }*@ | ||||
|         </dd> | ||||
|     </dl> | ||||
| </div> | ||||
| @ -0,0 +1,54 @@ | ||||
| @model ManageLoginsViewModel | ||||
| @using Microsoft.AspNetCore.Http.Authentication | ||||
| @{ | ||||
|     ViewData["Title"] = "Manage your external logins"; | ||||
| } | ||||
| 
 | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| 
 | ||||
| <p class="text-success">@ViewData["StatusMessage"]</p> | ||||
| @if (Model.CurrentLogins.Count > 0) | ||||
| { | ||||
|     <h4>Registered Logins</h4> | ||||
|     <table class="table"> | ||||
|         <tbody> | ||||
|             @for (var index = 0; index < Model.CurrentLogins.Count; index++) | ||||
|             { | ||||
|                 <tr> | ||||
|                     <td>@Model.CurrentLogins[index].LoginProvider</td> | ||||
|                     <td> | ||||
|                         @if ((bool)ViewData["ShowRemoveButton"]) | ||||
|                         { | ||||
|                             <form asp-controller="Manage" asp-action="RemoveLogin" method="post" class="form-horizontal"> | ||||
|                                 <div> | ||||
|                                     <input asp-for="@Model.CurrentLogins[index].LoginProvider" name="LoginProvider" type="hidden" /> | ||||
|                                     <input asp-for="@Model.CurrentLogins[index].ProviderKey" name="ProviderKey" type="hidden" /> | ||||
|                                     <input type="submit" class="btn btn-default" value="Remove" title="Remove this @Model.CurrentLogins[index].LoginProvider login from your account" /> | ||||
|                                 </div> | ||||
|                             </form> | ||||
|                         } | ||||
|                         else | ||||
|                         { | ||||
|                             @:   | ||||
|                         } | ||||
|                     </td> | ||||
|                 </tr> | ||||
|             } | ||||
|         </tbody> | ||||
|     </table> | ||||
| } | ||||
| @if (Model.OtherLogins.Count > 0) | ||||
| { | ||||
|     <h4>Add another service to log in.</h4> | ||||
|     <hr /> | ||||
|     <form asp-controller="Manage" asp-action="LinkLogin" method="post" class="form-horizontal"> | ||||
|         <div id="socialLoginList"> | ||||
|             <p> | ||||
|                 @foreach (var provider in Model.OtherLogins) | ||||
|                 { | ||||
|                     <button type="submit" class="btn btn-default" name="provider" value="@provider.AuthenticationScheme" title="Log in using your @provider.DisplayName account">@provider.AuthenticationScheme</button> | ||||
|                 } | ||||
|             </p> | ||||
|         </div> | ||||
|     </form> | ||||
| } | ||||
| @ -0,0 +1,38 @@ | ||||
| @model SetPasswordViewModel | ||||
| @{ | ||||
|     ViewData["Title"] = "Set Password"; | ||||
| } | ||||
| 
 | ||||
| <p class="text-info"> | ||||
|     You do not have a local username/password for this site. Add a local | ||||
|     account so you can log in without an external login. | ||||
| </p> | ||||
| 
 | ||||
| <form asp-controller="Manage" asp-action="SetPassword" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal"> | ||||
|     <h4>Set your password</h4> | ||||
|     <hr /> | ||||
|     <div asp-validation-summary="All" class="text-danger"></div> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="NewPassword" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="NewPassword" class="form-control" /> | ||||
|             <span asp-validation-for="NewPassword" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="ConfirmPassword" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="ConfirmPassword" class="form-control" /> | ||||
|             <span asp-validation-for="ConfirmPassword" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <div class="col-md-offset-2 col-md-10"> | ||||
|             <button type="submit" class="btn btn-default">Set password</button> | ||||
|         </div> | ||||
|     </div> | ||||
| </form> | ||||
| 
 | ||||
| @section Scripts { | ||||
|     @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } | ||||
| } | ||||
| @ -0,0 +1,30 @@ | ||||
| @model VerifyPhoneNumberViewModel | ||||
| @{ | ||||
|     ViewData["Title"] = "Verify Phone Number"; | ||||
| } | ||||
| 
 | ||||
| <h2>@ViewData["Title"].</h2> | ||||
| 
 | ||||
| <form asp-controller="Manage" asp-action="VerifyPhoneNumber" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal"> | ||||
|     <input asp-for="PhoneNumber" type="hidden" /> | ||||
|     <h4>Add a phone number.</h4> | ||||
|     <h5>@ViewData["Status"]</h5> | ||||
|     <hr /> | ||||
|     <div asp-validation-summary="All" class="text-danger"></div> | ||||
|     <div class="form-group"> | ||||
|         <label asp-for="Code" class="col-md-2 control-label"></label> | ||||
|         <div class="col-md-10"> | ||||
|             <input asp-for="Code" class="form-control" /> | ||||
|             <span asp-validation-for="Code" class="text-danger"></span> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|         <div class="col-md-offset-2 col-md-10"> | ||||
|             <button type="submit" class="btn btn-default">Submit</button> | ||||
|         </div> | ||||
|     </div> | ||||
| </form> | ||||
| 
 | ||||
| @section Scripts { | ||||
|     @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } | ||||
| } | ||||
| @ -0,0 +1,14 @@ | ||||
| @{ | ||||
|     ViewData["Title"] = "Error"; | ||||
| } | ||||
| 
 | ||||
| <h1 class="text-danger">Error.</h1> | ||||
| <h2 class="text-danger">An error occurred while processing your request.</h2> | ||||
| 
 | ||||
| <h3>Development Mode</h3> | ||||
| <p> | ||||
|     Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred. | ||||
| </p> | ||||
| <p> | ||||
|     <strong>Development environment should not be enabled in deployed applications</strong>, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>, and restarting the application. | ||||
| </p> | ||||
| @ -0,0 +1,68 @@ | ||||
| <!DOCTYPE html> | ||||
| <html> | ||||
| <head> | ||||
|     <meta charset="utf-8" /> | ||||
|     <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||||
|     <title>@ViewData["Title"] - Microsoft.Containerized_eShop.WebMVC</title> | ||||
| 
 | ||||
|     <environment names="Development"> | ||||
|         <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" /> | ||||
|         <link rel="stylesheet" href="~/css/site.css" /> | ||||
|     </environment> | ||||
|     <environment names="Staging,Production"> | ||||
|         <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.6/css/bootstrap.min.css" | ||||
|               asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css" | ||||
|               asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" /> | ||||
|         <link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" /> | ||||
|     </environment> | ||||
| </head> | ||||
| <body> | ||||
|     <div class="navbar navbar-inverse navbar-fixed-top"> | ||||
|         <div class="container"> | ||||
|             <div class="navbar-header"> | ||||
|                 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> | ||||
|                     <span class="sr-only">Toggle navigation</span> | ||||
|                     <span class="icon-bar"></span> | ||||
|                     <span class="icon-bar"></span> | ||||
|                     <span class="icon-bar"></span> | ||||
|                 </button> | ||||
|                 <a asp-area="" asp-controller="Home" asp-action="Index" class="navbar-brand">Microsoft.Containerized_eShop.WebMVC</a> | ||||
|             </div> | ||||
|             <div class="navbar-collapse collapse"> | ||||
|                 <ul class="nav navbar-nav"> | ||||
|                     <li><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li> | ||||
|                     <li><a asp-area="" asp-controller="Home" asp-action="About">About</a></li> | ||||
|                     <li><a asp-area="" asp-controller="Home" asp-action="Contact">Contact</a></li> | ||||
|                 </ul> | ||||
|                 @await Html.PartialAsync("_LoginPartial") | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
|     <div class="container body-content"> | ||||
|         @RenderBody() | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2016 - Microsoft.Containerized_eShop.WebMVC</p> | ||||
|         </footer> | ||||
|     </div> | ||||
| 
 | ||||
|     <environment names="Development"> | ||||
|         <script src="~/lib/jquery/dist/jquery.js"></script> | ||||
|         <script src="~/lib/bootstrap/dist/js/bootstrap.js"></script> | ||||
|         <script src="~/js/site.js" asp-append-version="true"></script> | ||||
|     </environment> | ||||
|     <environment names="Staging,Production"> | ||||
|         <script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.0.min.js" | ||||
|                 asp-fallback-src="~/lib/jquery/dist/jquery.min.js" | ||||
|                 asp-fallback-test="window.jQuery"> | ||||
|         </script> | ||||
|         <script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.6/bootstrap.min.js" | ||||
|                 asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js" | ||||
|                 asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"> | ||||
|         </script> | ||||
|         <script src="~/js/site.min.js" asp-append-version="true"></script> | ||||
|     </environment> | ||||
| 
 | ||||
|     @RenderSection("scripts", required: false) | ||||
| </body> | ||||
| </html> | ||||
| @ -0,0 +1,26 @@ | ||||
| @using Microsoft.AspNetCore.Identity | ||||
| @using Microsoft.Containerized_eShop.WebMVC.Models | ||||
| 
 | ||||
| @inject SignInManager<ApplicationUser> SignInManager | ||||
| @inject UserManager<ApplicationUser> UserManager | ||||
| 
 | ||||
| @if (SignInManager.IsSignedIn(User)) | ||||
| { | ||||
|     <form asp-area="" asp-controller="Account" asp-action="LogOff" method="post" id="logoutForm" class="navbar-right"> | ||||
|         <ul class="nav navbar-nav navbar-right"> | ||||
|             <li> | ||||
|                 <a asp-area="" asp-controller="Manage" asp-action="Index" title="Manage">Hello @UserManager.GetUserName(User)!</a> | ||||
|             </li> | ||||
|             <li> | ||||
|                 <button type="submit" class="btn btn-link navbar-btn navbar-link">Log off</button> | ||||
|             </li> | ||||
|         </ul> | ||||
|     </form> | ||||
| } | ||||
| else | ||||
| { | ||||
|     <ul class="nav navbar-nav navbar-right"> | ||||
|         <li><a asp-area="" asp-controller="Account" asp-action="Register">Register</a></li> | ||||
|         <li><a asp-area="" asp-controller="Account" asp-action="Login">Log in</a></li> | ||||
|     </ul> | ||||
| } | ||||
| @ -0,0 +1,14 @@ | ||||
| <environment names="Development"> | ||||
|     <script src="~/lib/jquery-validation/dist/jquery.validate.js"></script> | ||||
|     <script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script> | ||||
| </environment> | ||||
| <environment names="Staging,Production"> | ||||
|     <script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js" | ||||
|             asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js" | ||||
|             asp-fallback-test="window.jQuery && window.jQuery.validator"> | ||||
|     </script> | ||||
|     <script src="https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.6/jquery.validate.unobtrusive.min.js" | ||||
|             asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js" | ||||
|             asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive"> | ||||
|     </script> | ||||
| </environment> | ||||
| @ -0,0 +1,6 @@ | ||||
| @using Microsoft.Containerized_eShop.WebMVC | ||||
| @using Microsoft.Containerized_eShop.WebMVC.Models | ||||
| @using Microsoft.Containerized_eShop.WebMVC.Models.AccountViewModels | ||||
| @using Microsoft.Containerized_eShop.WebMVC.Models.ManageViewModels | ||||
| @using Microsoft.AspNetCore.Identity | ||||
| @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers | ||||
| @ -0,0 +1,3 @@ | ||||
| @{ | ||||
|     Layout = "_Layout"; | ||||
| } | ||||
| @ -0,0 +1,13 @@ | ||||
| { | ||||
|   "ConnectionStrings": { | ||||
|     "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-Microsoft.Containerized_eShop.WebMVC-10bbf6dc-4800-47aa-b85b-f26a9fbde74c;Trusted_Connection=True;MultipleActiveResultSets=true" | ||||
|   }, | ||||
|   "Logging": { | ||||
|     "IncludeScopes": false, | ||||
|     "LogLevel": { | ||||
|       "Default": "Debug", | ||||
|       "System": "Information", | ||||
|       "Microsoft": "Information" | ||||
|     } | ||||
|   } | ||||
| } | ||||
							
								
								
									
										10
									
								
								src/Web/Microsoft.Containerized-eShop.WebMVC/bower.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								src/Web/Microsoft.Containerized-eShop.WebMVC/bower.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,10 @@ | ||||
| { | ||||
|   "name": "asp.net", | ||||
|   "private": true, | ||||
|   "dependencies": { | ||||
|     "bootstrap": "3.3.6", | ||||
|     "jquery": "2.2.0", | ||||
|     "jquery-validation": "1.14.0", | ||||
|     "jquery-validation-unobtrusive": "3.2.6" | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,24 @@ | ||||
| // Configure bundling and minification for the project. | ||||
| // More info at https://go.microsoft.com/fwlink/?LinkId=808241 | ||||
| [ | ||||
|   { | ||||
|     "outputFileName": "wwwroot/css/site.min.css", | ||||
|     // An array of relative input file paths. Globbing patterns supported | ||||
|     "inputFiles": [ | ||||
|       "wwwroot/css/site.css" | ||||
|     ] | ||||
|   }, | ||||
|   { | ||||
|     "outputFileName": "wwwroot/js/site.min.js", | ||||
|     "inputFiles": [ | ||||
|       "wwwroot/js/site.js" | ||||
|     ], | ||||
|     // Optionally specify minification options | ||||
|     "minify": { | ||||
|       "enabled": true, | ||||
|       "renameLocals": true | ||||
|     }, | ||||
|     // Optinally generate .map file | ||||
|     "sourceMap": false | ||||
|   } | ||||
| ] | ||||
							
								
								
									
										96
									
								
								src/Web/Microsoft.Containerized-eShop.WebMVC/project.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										96
									
								
								src/Web/Microsoft.Containerized-eShop.WebMVC/project.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,96 @@ | ||||
| { | ||||
|   "userSecretsId": "aspnet-Microsoft.Containerized_eShop.WebMVC-10bbf6dc-4800-47aa-b85b-f26a9fbde74c", | ||||
| 
 | ||||
|   "dependencies": { | ||||
|     "Microsoft.NETCore.App": { | ||||
|       "version": "1.0.0", | ||||
|       "type": "platform" | ||||
|     }, | ||||
|     "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", | ||||
|     "Microsoft.AspNetCore.Diagnostics": "1.0.0", | ||||
|     "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0", | ||||
|     "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0", | ||||
|     "Microsoft.AspNetCore.Mvc": "1.0.0", | ||||
|     "Microsoft.AspNetCore.Razor.Tools": { | ||||
|       "version": "1.0.0-preview2-final", | ||||
|       "type": "build" | ||||
|     }, | ||||
|     "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", | ||||
|     "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", | ||||
|     "Microsoft.AspNetCore.StaticFiles": "1.0.0", | ||||
|     "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0", | ||||
|     "Microsoft.EntityFrameworkCore.SqlServer.Design": { | ||||
|       "version": "1.0.0", | ||||
|       "type": "build" | ||||
|     }, | ||||
|     "Microsoft.EntityFrameworkCore.Tools": { | ||||
|       "version": "1.0.0-preview2-final", | ||||
|       "type": "build" | ||||
|     }, | ||||
|     "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", | ||||
|     "Microsoft.Extensions.Configuration.Json": "1.0.0", | ||||
|     "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0", | ||||
|     "Microsoft.Extensions.Logging": "1.0.0", | ||||
|     "Microsoft.Extensions.Logging.Console": "1.0.0", | ||||
|     "Microsoft.Extensions.Logging.Debug": "1.0.0", | ||||
|     "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0", | ||||
|     "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0", | ||||
|     "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { | ||||
|       "version": "1.0.0-preview2-final", | ||||
|       "type": "build" | ||||
|     }, | ||||
|     "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { | ||||
|       "version": "1.0.0-preview2-final", | ||||
|       "type": "build" | ||||
|     } | ||||
|   }, | ||||
| 
 | ||||
|   "tools": { | ||||
|     "BundlerMinifier.Core": "2.0.238", | ||||
|     "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final", | ||||
|     "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final", | ||||
|     "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final", | ||||
|     "Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final", | ||||
|     "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { | ||||
|       "version": "1.0.0-preview2-final", | ||||
|       "imports": [ | ||||
|         "portable-net45+win8" | ||||
|       ] | ||||
|     } | ||||
|   }, | ||||
| 
 | ||||
|   "frameworks": { | ||||
|     "netcoreapp1.0": { | ||||
|       "imports": [ | ||||
|         "dotnet5.6", | ||||
|         "portable-net45+win8" | ||||
|       ] | ||||
|     } | ||||
|   }, | ||||
| 
 | ||||
|   "buildOptions": { | ||||
|     "emitEntryPoint": true, | ||||
|     "preserveCompilationContext": true | ||||
|   }, | ||||
| 
 | ||||
|   "runtimeOptions": { | ||||
|     "configProperties": { | ||||
|       "System.GC.Server": true | ||||
|     } | ||||
|   }, | ||||
| 
 | ||||
|   "publishOptions": { | ||||
|     "include": [ | ||||
|       "wwwroot", | ||||
|       "Views", | ||||
|       "Areas/**/Views", | ||||
|       "appsettings.json", | ||||
|       "web.config" | ||||
|     ] | ||||
|   }, | ||||
| 
 | ||||
|   "scripts": { | ||||
|     "prepublish": [ "bower install", "dotnet bundle" ], | ||||
|     "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] | ||||
|   } | ||||
| } | ||||
							
								
								
									
										14
									
								
								src/Web/Microsoft.Containerized-eShop.WebMVC/web.config
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								src/Web/Microsoft.Containerized-eShop.WebMVC/web.config
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,14 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <configuration> | ||||
| 
 | ||||
|   <!-- | ||||
|     Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380 | ||||
|   --> | ||||
| 
 | ||||
|   <system.webServer> | ||||
|     <handlers> | ||||
|       <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/> | ||||
|     </handlers> | ||||
|     <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/> | ||||
|   </system.webServer> | ||||
| </configuration> | ||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user