├── .gitattributes ├── .gitignore ├── ASP.NET-Core-SPAs.sln ├── LICENSE ├── README.md ├── global.json └── src └── ASP.NET-Core-SPAs ├── .bowerrc ├── API └── ContactsApiController.cs ├── ASP.NET-Core-SPAs.xproj ├── Angular ├── app.component.js ├── app.component.js.map ├── app.component.ts ├── boot.js ├── boot.js.map ├── boot.ts ├── contact-detail.component.js ├── contact-detail.component.js.map ├── contact-detail.component.ts ├── contact.js ├── contact.js.map ├── contact.service.js ├── contact.service.js.map ├── contact.service.ts ├── contact.ts └── systemjs.config.js ├── Contexts └── ContactsDbContext.cs ├── Controllers ├── AccountController.cs ├── ContactsController.cs ├── HomeController.cs └── ManageController.cs ├── Migrations ├── 00000000000000_CreateIdentitySchema.Designer.cs ├── 00000000000000_CreateIdentitySchema.cs ├── 20160205214715_Init.Designer.cs ├── 20160205214715_Init.cs ├── ApplicationDbContextModelSnapshot.cs └── ContactsDbContextModelSnapshot.cs ├── Models ├── ApplicationDbContext.cs ├── ApplicationUser.cs └── Contact.cs ├── Program.cs ├── Project_Readme.html ├── Properties └── launchSettings.json ├── Services ├── IEmailSender.cs ├── ISmsSender.cs └── MessageServices.cs ├── Startup.cs ├── ViewModels ├── Account │ ├── ExternalLoginConfirmationViewModel.cs │ ├── ForgotPasswordViewModel.cs │ ├── LoginViewModel.cs │ ├── RegisterViewModel.cs │ ├── ResetPasswordViewModel.cs │ ├── SendCodeViewModel.cs │ └── VerifyCodeViewModel.cs └── Manage │ ├── AddPhoneNumberViewModel.cs │ ├── ChangePasswordViewModel.cs │ ├── ConfigureTwoFactorViewModel.cs │ ├── FactorViewModel.cs │ ├── IndexViewModel.cs │ ├── ManageLoginsViewModel.cs │ ├── RemoveLoginViewModel.cs │ ├── SetPasswordViewModel.cs │ └── VerifyPhoneNumberViewModel.cs ├── Views ├── Account │ ├── ConfirmEmail.cshtml │ ├── ExternalLoginConfirmation.cshtml │ ├── ExternalLoginFailure.cshtml │ ├── ForgotPassword.cshtml │ ├── ForgotPasswordConfirmation.cshtml │ ├── Lockout.cshtml │ ├── Login.cshtml │ ├── Register.cshtml │ ├── ResetPassword.cshtml │ ├── ResetPasswordConfirmation.cshtml │ ├── SendCode.cshtml │ └── VerifyCode.cshtml ├── Contacts │ ├── Create.cshtml │ ├── Delete.cshtml │ ├── Details.cshtml │ ├── Edit.cshtml │ └── Index.cshtml ├── Home │ ├── Angular2.cshtml │ ├── Aurelia.cshtml │ └── Index.cshtml ├── Manage │ ├── AddPhoneNumber.cshtml │ ├── ChangePassword.cshtml │ ├── Index.cshtml │ ├── ManageLogins.cshtml │ ├── SetPassword.cshtml │ └── VerifyPhoneNumber.cshtml ├── Shared │ ├── Error.cshtml │ ├── _Layout.cshtml │ ├── _LoginPartial.cshtml │ └── _ValidationScriptsPartial.cshtml ├── _ViewImports.cshtml └── _ViewStart.cshtml ├── appsettings.json ├── bower.json ├── gulpfile.js ├── jsconfig.json ├── package.json ├── project.json ├── tsconfig.json ├── typings.json ├── typings ├── browser.d.ts ├── browser │ └── ambient │ │ └── es6-shim │ │ └── es6-shim.d.ts ├── main.d.ts └── main │ └── ambient │ └── es6-shim │ └── es6-shim.d.ts ├── web.config └── wwwroot ├── Angular └── app │ ├── app.component.js │ ├── boot.js │ ├── contact-detail.component.js │ ├── contact.js │ ├── contact.service.js │ └── systemjs.config.js ├── Aurelia ├── app.html ├── app.js ├── contact-detail.html ├── contact-detail.js └── contactService.js ├── _references.js ├── config.js ├── css └── site.css ├── favicon.ico ├── images ├── ASP-NET-Banners-01.png ├── ASP-NET-Banners-02.png ├── Banner-01-Azure.png └── Banner-02-VS.png ├── js └── site.js ├── lib ├── bootstrap │ ├── .bower.json │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ └── bootstrap.min.css │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ └── npm.js ├── jquery-validation-unobtrusive │ ├── .bower.json │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js ├── jquery-validation │ ├── .bower.json │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js └── jquery │ ├── .bower.json │ ├── MIT-LICENSE.txt │ └── dist │ ├── jquery.js │ ├── jquery.min.js │ └── jquery.min.map └── web.config /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | 24 | # Visual Studio 2015 cache/options directory 25 | .vs/ 26 | # Uncomment if you have tasks that create the project's static files in wwwroot 27 | #wwwroot/ 28 | 29 | # MSTest test Results 30 | [Tt]est[Rr]esult*/ 31 | [Bb]uild[Ll]og.* 32 | 33 | # NUNIT 34 | *.VisualState.xml 35 | TestResult.xml 36 | 37 | # Build Results of an ATL Project 38 | [Dd]ebugPS/ 39 | [Rr]eleasePS/ 40 | dlldata.c 41 | 42 | # DNX 43 | project.lock.json 44 | artifacts/ 45 | 46 | *_i.c 47 | *_p.c 48 | *_i.h 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.tmp_proj 63 | *.log 64 | *.vspscc 65 | *.vssscc 66 | .builds 67 | *.pidb 68 | *.svclog 69 | *.scc 70 | 71 | # Chutzpah Test files 72 | _Chutzpah* 73 | 74 | # Visual C++ cache files 75 | ipch/ 76 | *.aps 77 | *.ncb 78 | *.opendb 79 | *.opensdf 80 | *.sdf 81 | *.cachefile 82 | 83 | # Visual Studio profiler 84 | *.psess 85 | *.vsp 86 | *.vspx 87 | *.sap 88 | 89 | # TFS 2012 Local Workspace 90 | $tf/ 91 | 92 | # Guidance Automation Toolkit 93 | *.gpState 94 | 95 | # ReSharper is a .NET coding add-in 96 | _ReSharper*/ 97 | *.[Rr]e[Ss]harper 98 | *.DotSettings.user 99 | 100 | # JustCode is a .NET coding add-in 101 | .JustCode 102 | 103 | # TeamCity is a build add-in 104 | _TeamCity* 105 | 106 | # DotCover is a Code Coverage Tool 107 | *.dotCover 108 | 109 | # NCrunch 110 | _NCrunch_* 111 | .*crunch*.local.xml 112 | nCrunchTemp_* 113 | 114 | # MightyMoose 115 | *.mm.* 116 | AutoTest.Net/ 117 | 118 | # Web workbench (sass) 119 | .sass-cache/ 120 | 121 | # Installshield output folder 122 | [Ee]xpress/ 123 | 124 | # DocProject is a documentation generator add-in 125 | DocProject/buildhelp/ 126 | DocProject/Help/*.HxT 127 | DocProject/Help/*.HxC 128 | DocProject/Help/*.hhc 129 | DocProject/Help/*.hhk 130 | DocProject/Help/*.hhp 131 | DocProject/Help/Html2 132 | DocProject/Help/html 133 | 134 | # Click-Once directory 135 | publish/ 136 | 137 | # Publish Web Output 138 | *.[Pp]ublish.xml 139 | *.azurePubxml 140 | # TODO: Comment the next line if you want to checkin your web deploy settings 141 | # but database connection strings (with potential passwords) will be unencrypted 142 | *.pubxml 143 | *.publishproj 144 | 145 | # NuGet Packages 146 | *.nupkg 147 | # The packages folder can be ignored because of Package Restore 148 | **/packages/* 149 | # except build/, which is used as an MSBuild target. 150 | !**/packages/build/ 151 | # Uncomment if necessary however generally it will be regenerated when needed 152 | #!**/packages/repositories.config 153 | # NuGet v3's project.json files produces more ignoreable files 154 | *.nuget.props 155 | *.nuget.targets 156 | 157 | # Microsoft Azure Build Output 158 | csx/ 159 | *.build.csdef 160 | 161 | # Microsoft Azure Emulator 162 | ecf/ 163 | rcf/ 164 | 165 | # Microsoft Azure ApplicationInsights config file 166 | ApplicationInsights.config 167 | 168 | # Windows Store app package directory 169 | AppPackages/ 170 | BundleArtifacts/ 171 | 172 | # Visual Studio cache files 173 | # files ending in .cache can be ignored 174 | *.[Cc]ache 175 | # but keep track of directories ending in .cache 176 | !*.[Cc]ache/ 177 | 178 | # Others 179 | ClientBin/ 180 | ~$* 181 | *~ 182 | *.dbmdl 183 | *.dbproj.schemaview 184 | *.pfx 185 | *.publishsettings 186 | node_modules/ 187 | orleans.codegen.cs 188 | 189 | # RIA/Silverlight projects 190 | Generated_Code/ 191 | 192 | # Backup & report files from converting an old project file 193 | # to a newer Visual Studio version. Backup files are not needed, 194 | # because we have git ;-) 195 | _UpgradeReport_Files/ 196 | Backup*/ 197 | UpgradeLog*.XML 198 | UpgradeLog*.htm 199 | 200 | # SQL Server files 201 | *.mdf 202 | *.ldf 203 | 204 | # Business Intelligence projects 205 | *.rdl.data 206 | *.bim.layout 207 | *.bim_*.settings 208 | 209 | # Microsoft Fakes 210 | FakesAssemblies/ 211 | 212 | # GhostDoc plugin setting file 213 | *.GhostDoc.xml 214 | 215 | # Node.js Tools for Visual Studio 216 | .ntvs_analysis.dat 217 | 218 | # Visual Studio 6 build log 219 | *.plg 220 | 221 | # Visual Studio 6 workspace options file 222 | *.opt 223 | 224 | # Visual Studio LightSwitch build output 225 | **/*.HTMLClient/GeneratedArtifacts 226 | **/*.DesktopClient/GeneratedArtifacts 227 | **/*.DesktopClient/ModelManifest.xml 228 | **/*.Server/GeneratedArtifacts 229 | **/*.Server/ModelManifest.xml 230 | _Pvt_Extensions 231 | 232 | # Paket dependency manager 233 | .paket/paket.exe 234 | 235 | # FAKE - F# Make 236 | .fake/ 237 | 238 | # wwwRoot Angualr 2 libs 239 | src/ASP.NET-Core-SPAs/wwwroot/Angular/lib/ -------------------------------------------------------------------------------- /ASP.NET-Core-SPAs.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5E6E953A-3E18-4A65-A1FD-8B0397B1E3BE}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5A91D554-87B0-43BA-B1AF-783D0E9840AA}" 9 | ProjectSection(SolutionItems) = preProject 10 | global.json = global.json 11 | EndProjectSection 12 | EndProject 13 | Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ASP.NET-Core-SPAs", "src\ASP.NET-Core-SPAs\ASP.NET-Core-SPAs.xproj", "{33CACBF0-4BCC-4AF8-AB11-ADBCB6259F88}" 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Any CPU = Debug|Any CPU 18 | Release|Any CPU = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {33CACBF0-4BCC-4AF8-AB11-ADBCB6259F88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 22 | {33CACBF0-4BCC-4AF8-AB11-ADBCB6259F88}.Debug|Any CPU.Build.0 = Debug|Any CPU 23 | {33CACBF0-4BCC-4AF8-AB11-ADBCB6259F88}.Release|Any CPU.ActiveCfg = Release|Any CPU 24 | {33CACBF0-4BCC-4AF8-AB11-ADBCB6259F88}.Release|Any CPU.Build.0 = Release|Any CPU 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | GlobalSection(NestedProjects) = preSolution 30 | {33CACBF0-4BCC-4AF8-AB11-ADBCB6259F88} = {5E6E953A-3E18-4A65-A1FD-8B0397B1E3BE} 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Eric Anderson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## This repo has been replaced 2 | The **[ASP.NET-Core-Basics](https://github.com/elanderson/ASP.NET-Core-Basics) repo** now contains basically everything this repo was trying to do, but layed out it a clearer way. **Please use it for future reference.** 3 | 4 | ## Below is the orginal readme, but really go use the [ASP.NET-Core-Basics](https://github.com/elanderson/ASP.NET-Core-Basics) repo instead 5 | #### Getting started with ASP.NET-Core-SPAs 6 | ##### [This](http://www.elanderson.net/2016/02/asp-net-core-project-with-angular-2-aurelia-and-an-api/) blog post is a guide to get the code up and running. 7 | 8 | #### Why 9 | ##### This project will gives a jumping off point to experiment with [Angular 2](https://angular.io/) and [Aurelia](http://aurelia.io/) from inside the same project. Both of these frameworks repersent the next generation of [SPA](https://en.wikipedia.org/wiki/Single-page_application) frameworks. 10 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": [ "src", "test" ], 3 | "sdk": { 4 | "version": "1.0.0-preview2-003121" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "wwwroot/lib" 3 | } 4 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/API/ContactsApiController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Http; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.EntityFrameworkCore; 7 | using ASP.NET_Core_SPAs.Contexts; 8 | using ASP.NET_Core_SPAs.Models; 9 | using Microsoft.AspNetCore.Authorization; 10 | using Microsoft.AspNetCore.Identity; 11 | 12 | namespace ASP.NET_Core_SPAs.API 13 | { 14 | [Authorize] 15 | [Produces("application/json")] 16 | [Route("api/Contacts")] 17 | public class ContactsApiController : Controller 18 | { 19 | private readonly ContactsDbContext _context; 20 | private readonly UserManager _userManager; 21 | 22 | public ContactsApiController(UserManager userManager, 23 | ContactsDbContext context) 24 | { 25 | _userManager = userManager; 26 | _context = context; 27 | } 28 | 29 | // GET: api/ContactsApi 30 | [HttpGet] 31 | public async Task> GetAllContacts() 32 | { 33 | return await GetContacts().ToListAsync(); 34 | } 35 | 36 | // GET: api/ContactsApi/5 37 | [HttpGet("{id}", Name = "GetContact")] 38 | public async Task GetContact([FromRoute] int id) 39 | { 40 | if (!ModelState.IsValid) 41 | { 42 | return BadRequest(ModelState); 43 | } 44 | 45 | var contact = await GetContacts().SingleAsync(m => m.Id == id); 46 | 47 | if (contact == null) 48 | { 49 | return NotFound(); 50 | } 51 | 52 | return Ok(contact); 53 | } 54 | 55 | // PUT: api/ContactsApi/5 56 | [HttpPut("{id}")] 57 | public async Task PutContact([FromRoute] int id, [FromBody] Contact contact) 58 | { 59 | if (!ModelState.IsValid) 60 | { 61 | return BadRequest(ModelState); 62 | } 63 | 64 | if (id != contact.Id || 65 | _userManager.GetUserId(User) != contact.UserId) 66 | { 67 | return BadRequest(); 68 | } 69 | 70 | _context.Entry(contact).State = EntityState.Modified; 71 | 72 | try 73 | { 74 | await _context.SaveChangesAsync(); 75 | } 76 | catch (DbUpdateConcurrencyException) 77 | { 78 | if (!ContactExists(id)) 79 | { 80 | return NotFound(); 81 | } 82 | 83 | throw; 84 | } 85 | 86 | return new StatusCodeResult(StatusCodes.Status204NoContent); 87 | } 88 | 89 | // POST: api/ContactsApi 90 | [HttpPost] 91 | public async Task PostContact([FromBody] Contact contact) 92 | { 93 | if (!ModelState.IsValid) 94 | { 95 | return BadRequest(ModelState); 96 | } 97 | 98 | contact.UserId = _userManager.GetUserId(User); 99 | _context.Contacts.Add(contact); 100 | try 101 | { 102 | await _context.SaveChangesAsync(); 103 | } 104 | catch (DbUpdateException) 105 | { 106 | if (ContactExists(contact.Id)) 107 | { 108 | return new StatusCodeResult(StatusCodes.Status409Conflict); 109 | } 110 | 111 | throw; 112 | } 113 | 114 | return CreatedAtRoute("GetContact", new { id = contact.Id }, contact); 115 | } 116 | 117 | // DELETE: api/ContactsApi/5 118 | [HttpDelete("{id}")] 119 | public async Task DeleteContact([FromRoute] int id) 120 | { 121 | if (!ModelState.IsValid) 122 | { 123 | return BadRequest(ModelState); 124 | } 125 | 126 | var contact = await GetContacts().SingleAsync(m => m.Id == id); 127 | if (contact == null) 128 | { 129 | return NotFound(); 130 | } 131 | 132 | _context.Contacts.Remove(contact); 133 | await _context.SaveChangesAsync(); 134 | 135 | return Ok(contact); 136 | } 137 | 138 | protected override void Dispose(bool disposing) 139 | { 140 | if (disposing) 141 | { 142 | _context.Dispose(); 143 | } 144 | base.Dispose(disposing); 145 | } 146 | 147 | private bool ContactExists(int id) 148 | { 149 | return _context.Contacts.Count(e => e.Id == id) > 0; 150 | } 151 | 152 | private IQueryable GetContacts() 153 | { 154 | return _context.Contacts.Where(c => c.UserId == _userManager.GetUserId(User)); 155 | } 156 | } 157 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ASP.NET-Core-SPAs.xproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 14.0 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | 7 | 8 | 9 | 33cacbf0-4bcc-4af8-ab11-adbcb6259f88 10 | ASP.NET_Core_SPAs 11 | ..\..\artifacts\obj\$(MSBuildProjectName) 12 | .\bin\ 13 | 14 | 15 | 2.0 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/app.component.js: -------------------------------------------------------------------------------- 1 | System.register(['@angular/core', '@angular/http', './contact-detail.component', './contact.service', 'rxjs/Rx'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 5 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 6 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 7 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 8 | return c > 3 && r && Object.defineProperty(target, key, r), r; 9 | }; 10 | var __metadata = (this && this.__metadata) || function (k, v) { 11 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 12 | }; 13 | var core_1, http_1, contact_detail_component_1, contact_service_1; 14 | var AppComponent; 15 | return { 16 | setters:[ 17 | function (core_1_1) { 18 | core_1 = core_1_1; 19 | }, 20 | function (http_1_1) { 21 | http_1 = http_1_1; 22 | }, 23 | function (contact_detail_component_1_1) { 24 | contact_detail_component_1 = contact_detail_component_1_1; 25 | }, 26 | function (contact_service_1_1) { 27 | contact_service_1 = contact_service_1_1; 28 | }, 29 | function (_1) {}], 30 | execute: function() { 31 | AppComponent = (function () { 32 | function AppComponent(_contactService) { 33 | this._contactService = _contactService; 34 | this.title = 'Contact List'; 35 | } 36 | AppComponent.prototype.getContacts = function () { 37 | var _this = this; 38 | this._contactService.getContacts() 39 | .subscribe(function (contacts) { 40 | console.log(contacts); 41 | _this.contacts = contacts; 42 | }, function (error) { return alert(error); }); 43 | }; 44 | AppComponent.prototype.ngOnInit = function () { 45 | this.getContacts(); 46 | }; 47 | AppComponent.prototype.onSelect = function (contact) { 48 | this.selectedContact = contact; 49 | }; 50 | AppComponent = __decorate([ 51 | core_1.Component({ 52 | selector: 'my-app', 53 | template: "\n

{{title}}

\n
    \n
  • \n {{contact.Id}} {{contact.Name}}\n
  • \n
\n \n ", 54 | directives: [contact_detail_component_1.ContactDetailComponent], 55 | providers: [ 56 | http_1.HTTP_PROVIDERS, 57 | contact_service_1.ContactService 58 | ] 59 | }), 60 | __metadata('design:paramtypes', [contact_service_1.ContactService]) 61 | ], AppComponent); 62 | return AppComponent; 63 | }()); 64 | exports_1("AppComponent", AppComponent); 65 | } 66 | } 67 | }); 68 | //# sourceMappingURL=app.component.js.map -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/app.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"app.component.js","sourceRoot":"","sources":["app.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4BA;gBAKI,sBAAoB,eAA+B;oBAA/B,oBAAe,GAAf,eAAe,CAAgB;oBAJ5C,UAAK,GAAG,cAAc,CAAC;gBAIyB,CAAC;gBAExD,kCAAW,GAAX;oBAAA,iBAQC;oBAPG,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE;yBAC7B,SAAS,CACV,UAAA,QAAQ;wBACJ,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;wBACtB,KAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;oBAC7B,CAAC,EACD,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,KAAK,CAAC,EAAZ,CAAY,CAAC,CAAC;gBAC/B,CAAC;gBAED,+BAAQ,GAAR;oBACI,IAAI,CAAC,WAAW,EAAE,CAAC;gBACvB,CAAC;gBAED,+BAAQ,GAAR,UAAS,OAAgB;oBACrB,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC;gBACnC,CAAC;gBA3CL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,QAAQ;wBAClB,QAAQ,EAAE,qaAUL;wBACL,UAAU,EAAE,CAAC,iDAAsB,CAAC;wBACpC,SAAS,EAAE;4BACP,qBAAc;4BACd,gCAAc;yBACjB;qBACJ,CAAC;;gCAAA;gBA0BF,mBAAC;YAAD,CAAC,AAxBD,IAwBC;YAxBD,uCAwBC,CAAA"} -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/app.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | import {OnInit} from '@angular/core'; 3 | import {HTTP_PROVIDERS} from '@angular/http'; 4 | import {Contact} from './contact'; 5 | import {ContactDetailComponent} from './contact-detail.component'; 6 | import {ContactService} from './contact.service'; 7 | import 'rxjs/Rx'; 8 | 9 | @Component({ 10 | selector: 'my-app', 11 | template: ` 12 |

{{title}}

13 |
    14 |
  • 17 | {{contact.Id}} {{contact.Name}} 18 |
  • 19 |
20 | 21 | `, 22 | directives: [ContactDetailComponent], 23 | providers: [ 24 | HTTP_PROVIDERS, 25 | ContactService 26 | ] 27 | }) 28 | 29 | export class AppComponent implements OnInit { 30 | public title = 'Contact List'; 31 | public selectedContact: Contact; 32 | public contacts: Contact[]; 33 | 34 | constructor(private _contactService: ContactService) { } 35 | 36 | getContacts() { 37 | this._contactService.getContacts() 38 | .subscribe( 39 | contacts => { 40 | console.log(contacts); 41 | this.contacts = contacts; 42 | }, 43 | error => alert(error)); 44 | } 45 | 46 | ngOnInit() { 47 | this.getContacts(); 48 | } 49 | 50 | onSelect(contact: Contact) { 51 | this.selectedContact = contact; 52 | } 53 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/boot.js: -------------------------------------------------------------------------------- 1 | System.register(['@angular/platform-browser-dynamic', './app.component'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var platform_browser_dynamic_1, app_component_1; 5 | return { 6 | setters:[ 7 | function (platform_browser_dynamic_1_1) { 8 | platform_browser_dynamic_1 = platform_browser_dynamic_1_1; 9 | }, 10 | function (app_component_1_1) { 11 | app_component_1 = app_component_1_1; 12 | }], 13 | execute: function() { 14 | platform_browser_dynamic_1.bootstrap(app_component_1.AppComponent); 15 | } 16 | } 17 | }); 18 | //# sourceMappingURL=boot.js.map -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/boot.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"boot.js","sourceRoot":"","sources":["boot.ts"],"names":[],"mappings":";;;;;;;;;;;;;YAGA,oCAAS,CAAC,4BAAY,CAAC,CAAC"} -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/boot.ts: -------------------------------------------------------------------------------- 1 | import {bootstrap} from '@angular/platform-browser-dynamic' 2 | import {AppComponent} from './app.component' 3 | 4 | bootstrap(AppComponent); -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/contact-detail.component.js: -------------------------------------------------------------------------------- 1 | System.register(['@angular/core'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 5 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 6 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 7 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 8 | return c > 3 && r && Object.defineProperty(target, key, r), r; 9 | }; 10 | var __metadata = (this && this.__metadata) || function (k, v) { 11 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 12 | }; 13 | var core_1; 14 | var ContactDetailComponent; 15 | return { 16 | setters:[ 17 | function (core_1_1) { 18 | core_1 = core_1_1; 19 | }], 20 | execute: function() { 21 | ContactDetailComponent = (function () { 22 | function ContactDetailComponent() { 23 | } 24 | ContactDetailComponent = __decorate([ 25 | core_1.Component({ 26 | selector: 'contact-detail', 27 | template: "\n
\n

{{contact.Name}}

\n
{{contact.Id}}
\n
\n \n
\n
\n
\n \n
\n
\n
\n \n
\n
\n
\n ", 28 | inputs: ['contact'] 29 | }), 30 | __metadata('design:paramtypes', []) 31 | ], ContactDetailComponent); 32 | return ContactDetailComponent; 33 | }()); 34 | exports_1("ContactDetailComponent", ContactDetailComponent); 35 | } 36 | } 37 | }); 38 | //# sourceMappingURL=contact-detail.component.js.map -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/contact-detail.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"contact-detail.component.js","sourceRoot":"","sources":["contact-detail.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;YA0BA;gBAAA;gBAEA,CAAC;gBAzBD;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,gBAAgB;wBAC1B,QAAQ,EAAE,6pBAiBL;wBACL,MAAM,EAAE,CAAC,SAAS,CAAC;qBACtB,CAAC;;0CAAA;gBAIF,6BAAC;YAAD,CAAC,AAFD,IAEC;YAFD,2DAEC,CAAA"} -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/contact-detail.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | import {Contact} from './contact'; 3 | 4 | @Component({ 5 | selector: 'contact-detail', 6 | template: ` 7 |
8 |

{{contact.Name}}

9 |
{{contact.Id}}
10 |
11 | 12 |
13 |
14 |
15 | 16 |
17 |
18 |
19 | 20 |
21 |
22 |
23 | `, 24 | inputs: ['contact'] 25 | }) 26 | 27 | export class ContactDetailComponent { 28 | public contact: Contact; 29 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/contact.js: -------------------------------------------------------------------------------- 1 | System.register([], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | return { 5 | setters:[], 6 | execute: function() { 7 | } 8 | } 9 | }); 10 | //# sourceMappingURL=contact.js.map -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/contact.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"contact.js","sourceRoot":"","sources":["contact.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/contact.service.js: -------------------------------------------------------------------------------- 1 | System.register(['@angular/core', '@angular/http', 'rxjs/Observable'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 5 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 6 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 7 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 8 | return c > 3 && r && Object.defineProperty(target, key, r), r; 9 | }; 10 | var __metadata = (this && this.__metadata) || function (k, v) { 11 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 12 | }; 13 | var core_1, http_1, Observable_1; 14 | var ContactService; 15 | return { 16 | setters:[ 17 | function (core_1_1) { 18 | core_1 = core_1_1; 19 | }, 20 | function (http_1_1) { 21 | http_1 = http_1_1; 22 | }, 23 | function (Observable_1_1) { 24 | Observable_1 = Observable_1_1; 25 | }], 26 | execute: function() { 27 | ContactService = (function () { 28 | function ContactService(http) { 29 | this.http = http; 30 | this._url = 'http://localhost:6555/api/contacts/'; 31 | } 32 | ContactService.prototype.getContacts = function () { 33 | return this.http.get(this._url) 34 | .map(function (responce) { return responce.json(); }) 35 | .catch(function (error) { 36 | console.log(error); 37 | return Observable_1.Observable.throw(error); 38 | }); 39 | }; 40 | ContactService = __decorate([ 41 | core_1.Injectable(), 42 | __metadata('design:paramtypes', [http_1.Http]) 43 | ], ContactService); 44 | return ContactService; 45 | }()); 46 | exports_1("ContactService", ContactService); 47 | } 48 | } 49 | }); 50 | //# sourceMappingURL=contact.service.js.map -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/contact.service.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"contact.service.js","sourceRoot":"","sources":["contact.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;YAMA;gBAEI,wBAAoB,IAAU;oBAAV,SAAI,GAAJ,IAAI,CAAM;oBADtB,SAAI,GAAG,qCAAqC,CAAC;gBACnB,CAAC;gBAEnC,oCAAW,GAAX;oBACI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;yBAC1B,GAAG,CAAC,UAAA,QAAQ,IAAI,OAAW,QAAQ,CAAC,IAAI,EAAE,EAA1B,CAA0B,CAAC;yBAC3C,KAAK,CAAC,UAAA,KAAK;wBACR,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;wBACnB,MAAM,CAAC,uBAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACnC,CAAC,CAAC,CAAC;gBACX,CAAC;gBAZL;oBAAC,iBAAU,EAAE;;kCAAA;gBAab,qBAAC;YAAD,CAAC,AAZD,IAYC;YAZD,2CAYC,CAAA"} -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/contact.service.ts: -------------------------------------------------------------------------------- 1 | import {Injectable} from '@angular/core'; 2 | import {Http} from '@angular/http'; 3 | import {Contact} from './contact'; 4 | import {Observable} from 'rxjs/Observable'; 5 | 6 | @Injectable() 7 | export class ContactService { 8 | private _url = 'http://localhost:6555/api/contacts/'; 9 | constructor(private http: Http) { } 10 | 11 | getContacts() { 12 | return this.http.get(this._url) 13 | .map(responce => responce.json()) 14 | .catch(error => { 15 | console.log(error); 16 | return Observable.throw(error); 17 | }); 18 | } 19 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/contact.ts: -------------------------------------------------------------------------------- 1 | export interface Contact { 2 | Id: number; 3 | Name: string; 4 | EmailAddress: string; 5 | PhoneNumber: string; 6 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Angular/systemjs.config.js: -------------------------------------------------------------------------------- 1 | (function (global) { 2 | 3 | // map tells the System loader where to look for things 4 | var map = { 5 | 'app': '../Angular/app', 6 | 'rxjs': '../Angular/lib/rxjs', 7 | '@angular': '../Angular/lib/@angular' 8 | }; 9 | 10 | // packages tells the System loader how to load when no filename and/or no extension 11 | var packages = { 12 | 'app': { main: 'boot.js', defaultExtension: 'js' }, 13 | 'rxjs': { defaultExtension: 'js' } 14 | }; 15 | 16 | var packageNames = [ 17 | '@angular/common', 18 | '@angular/compiler', 19 | '@angular/core', 20 | '@angular/http', 21 | '@angular/platform-browser', 22 | '@angular/platform-browser-dynamic', 23 | '@angular/router', 24 | '@angular/router-deprecated', 25 | '@angular/testing', 26 | '@angular/upgrade' 27 | ]; 28 | 29 | // add package entries for angular packages in the form '@angular/common': { main: 'index.js', defaultExtension: 'js' } 30 | packageNames.forEach(function (pkgName) { 31 | packages[pkgName] = { main: 'index.js', defaultExtension: 'js' }; 32 | }); 33 | 34 | var config = { 35 | map: map, 36 | packages: packages 37 | } 38 | 39 | // filterSystemConfig - index.html's chance to modify config before we register it. 40 | if (global.filterSystemConfig) { global.filterSystemConfig(config); } 41 | 42 | System.config(config); 43 | 44 | })(this); -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Contexts/ContactsDbContext.cs: -------------------------------------------------------------------------------- 1 | using ASP.NET_Core_SPAs.Models; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Internal; 4 | 5 | namespace ASP.NET_Core_SPAs.Contexts 6 | { 7 | public sealed class ContactsDbContext : DbContext 8 | { 9 | private static bool _created; 10 | public DbSet Contacts { get; set; } 11 | 12 | public ContactsDbContext(DbContextOptions options) 13 | : base(options) 14 | { 15 | if (_created) return; 16 | Database.Migrate(); 17 | _created = true; 18 | } 19 | 20 | protected override void OnModelCreating(ModelBuilder builder) 21 | { 22 | foreach (var entity in builder.Model.GetEntityTypes()) 23 | { 24 | entity.Relational().TableName = entity.DisplayName(); 25 | } 26 | 27 | builder.Entity().HasKey(c => c.Id); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Controllers/ContactsController.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Threading.Tasks; 3 | using Microsoft.AspNetCore.Mvc; 4 | using ASP.NET_Core_SPAs.Contexts; 5 | using ASP.NET_Core_SPAs.Models; 6 | using Microsoft.AspNetCore.Authorization; 7 | using Microsoft.AspNetCore.Identity; 8 | using Microsoft.EntityFrameworkCore; 9 | 10 | namespace ASP.NET_Core_SPAs.Controllers 11 | { 12 | [Authorize] 13 | public class ContactsController : Controller 14 | { 15 | private readonly ContactsDbContext _context; 16 | private readonly UserManager _userManager; 17 | 18 | public ContactsController(UserManager userManager, 19 | ContactsDbContext context) 20 | { 21 | _userManager = userManager; 22 | _context = context; 23 | } 24 | 25 | // GET: Contacts 26 | public async Task Index() 27 | { 28 | return View(await GetContacts().ToListAsync()); 29 | } 30 | 31 | // GET: Contacts/Details/5 32 | public async Task Details(int? id) 33 | { 34 | if (id == null) 35 | { 36 | return NotFound(); 37 | } 38 | 39 | var contact = await GetContacts().SingleAsync(m => m.Id == id); 40 | if (contact == null) 41 | { 42 | return NotFound(); 43 | } 44 | 45 | return View(contact); 46 | } 47 | 48 | // GET: Contacts/Create 49 | public IActionResult Create() 50 | { 51 | return View(); 52 | } 53 | 54 | // POST: Contacts/Create 55 | [HttpPost] 56 | [ValidateAntiForgeryToken] 57 | public async Task Create(Contact contact) 58 | { 59 | if (ModelState.IsValid) 60 | { 61 | contact.UserId = _userManager.GetUserId(User); 62 | _context.Contacts.Add(contact); 63 | await _context.SaveChangesAsync(); 64 | return RedirectToAction("Index"); 65 | } 66 | return View(contact); 67 | } 68 | 69 | // GET: Contacts/Edit/5 70 | public async Task Edit(int? id) 71 | { 72 | if (id == null) 73 | { 74 | return NotFound(); 75 | } 76 | 77 | var contact = await GetContacts().SingleAsync(m => m.Id == id); 78 | if (contact == null) 79 | { 80 | return NotFound(); 81 | } 82 | return View(contact); 83 | } 84 | 85 | // POST: Contacts/Edit/5 86 | [HttpPost] 87 | [ValidateAntiForgeryToken] 88 | public async Task Edit(Contact contact) 89 | { 90 | if (ModelState.IsValid) 91 | { 92 | _context.Update(contact); 93 | await _context.SaveChangesAsync(); 94 | return RedirectToAction("Index"); 95 | } 96 | return View(contact); 97 | } 98 | 99 | // GET: Contacts/Delete/5 100 | [ActionName("Delete")] 101 | public async Task Delete(int? id) 102 | { 103 | if (id == null) 104 | { 105 | return NotFound(); 106 | } 107 | 108 | var contact = await GetContacts().SingleAsync(m => m.Id == id); 109 | if (contact == null) 110 | { 111 | return NotFound(); 112 | } 113 | 114 | return View(contact); 115 | } 116 | 117 | // POST: Contacts/Delete/5 118 | [HttpPost, ActionName("Delete")] 119 | [ValidateAntiForgeryToken] 120 | public async Task DeleteConfirmed(int id) 121 | { 122 | var contact = await GetContacts().SingleAsync(m => m.Id == id); 123 | _context.Contacts.Remove(contact); 124 | await _context.SaveChangesAsync(); 125 | return RedirectToAction("Index"); 126 | } 127 | 128 | private IQueryable GetContacts() 129 | { 130 | return _context.Contacts.Where(c => c.UserId == _userManager.GetUserId(User)); 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace ASP.NET_Core_SPAs.Controllers 4 | { 5 | public class HomeController : Controller 6 | { 7 | public IActionResult Index() 8 | { 9 | return View(); 10 | } 11 | 12 | public IActionResult Angular2() 13 | { 14 | return View(); 15 | } 16 | 17 | public IActionResult Aurelia() 18 | { 19 | return View(); 20 | } 21 | 22 | public IActionResult Error() 23 | { 24 | return View(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Controllers/ManageController.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Threading.Tasks; 3 | using Microsoft.AspNetCore.Authorization; 4 | using Microsoft.AspNetCore.Identity; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.Extensions.Logging; 7 | using ASP.NET_Core_SPAs.Models; 8 | using ASP.NET_Core_SPAs.Services; 9 | using ASP.NET_Core_SPAs.ViewModels.Manage; 10 | 11 | namespace ASP.NET_Core_SPAs.Controllers 12 | { 13 | [Authorize] 14 | public class ManageController : Controller 15 | { 16 | private readonly UserManager _userManager; 17 | private readonly SignInManager _signInManager; 18 | private readonly IEmailSender _emailSender; 19 | private readonly ISmsSender _smsSender; 20 | private readonly ILogger _logger; 21 | 22 | public ManageController( 23 | UserManager userManager, 24 | SignInManager signInManager, 25 | IEmailSender emailSender, 26 | ISmsSender smsSender, 27 | ILoggerFactory loggerFactory) 28 | { 29 | _userManager = userManager; 30 | _signInManager = signInManager; 31 | _emailSender = emailSender; 32 | _smsSender = smsSender; 33 | _logger = loggerFactory.CreateLogger(); 34 | } 35 | 36 | // 37 | // GET: /Manage/Index 38 | [HttpGet] 39 | public async Task Index(ManageMessageId? message = null) 40 | { 41 | ViewData["StatusMessage"] = 42 | message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." 43 | : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." 44 | : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." 45 | : message == ManageMessageId.Error ? "An error has occurred." 46 | : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." 47 | : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." 48 | : ""; 49 | 50 | var user = await GetCurrentUserAsync(); 51 | var model = new IndexViewModel 52 | { 53 | HasPassword = await _userManager.HasPasswordAsync(user), 54 | PhoneNumber = await _userManager.GetPhoneNumberAsync(user), 55 | TwoFactor = await _userManager.GetTwoFactorEnabledAsync(user), 56 | Logins = await _userManager.GetLoginsAsync(user), 57 | BrowserRemembered = await _signInManager.IsTwoFactorClientRememberedAsync(user) 58 | }; 59 | return View(model); 60 | } 61 | 62 | // 63 | // POST: /Manage/RemoveLogin 64 | [HttpPost] 65 | [ValidateAntiForgeryToken] 66 | public async Task RemoveLogin(RemoveLoginViewModel account) 67 | { 68 | ManageMessageId? message = ManageMessageId.Error; 69 | var user = await GetCurrentUserAsync(); 70 | if (user != null) 71 | { 72 | var result = await _userManager.RemoveLoginAsync(user, account.LoginProvider, account.ProviderKey); 73 | if (result.Succeeded) 74 | { 75 | await _signInManager.SignInAsync(user, isPersistent: false); 76 | message = ManageMessageId.RemoveLoginSuccess; 77 | } 78 | } 79 | return RedirectToAction(nameof(ManageLogins), new { Message = message }); 80 | } 81 | 82 | // 83 | // GET: /Manage/AddPhoneNumber 84 | public IActionResult AddPhoneNumber() 85 | { 86 | return View(); 87 | } 88 | 89 | // 90 | // POST: /Manage/AddPhoneNumber 91 | [HttpPost] 92 | [ValidateAntiForgeryToken] 93 | public async Task AddPhoneNumber(AddPhoneNumberViewModel model) 94 | { 95 | if (!ModelState.IsValid) 96 | { 97 | return View(model); 98 | } 99 | // Generate the token and send it 100 | var user = await GetCurrentUserAsync(); 101 | var code = await _userManager.GenerateChangePhoneNumberTokenAsync(user, model.PhoneNumber); 102 | await _smsSender.SendSmsAsync(model.PhoneNumber, "Your security code is: " + code); 103 | return RedirectToAction(nameof(VerifyPhoneNumber), new { PhoneNumber = model.PhoneNumber }); 104 | } 105 | 106 | // 107 | // POST: /Manage/EnableTwoFactorAuthentication 108 | [HttpPost] 109 | [ValidateAntiForgeryToken] 110 | public async Task EnableTwoFactorAuthentication() 111 | { 112 | var user = await GetCurrentUserAsync(); 113 | if (user != null) 114 | { 115 | await _userManager.SetTwoFactorEnabledAsync(user, true); 116 | await _signInManager.SignInAsync(user, isPersistent: false); 117 | _logger.LogInformation(1, "User enabled two-factor authentication."); 118 | } 119 | return RedirectToAction(nameof(Index), "Manage"); 120 | } 121 | 122 | // 123 | // POST: /Manage/DisableTwoFactorAuthentication 124 | [HttpPost] 125 | [ValidateAntiForgeryToken] 126 | public async Task DisableTwoFactorAuthentication() 127 | { 128 | var user = await GetCurrentUserAsync(); 129 | if (user != null) 130 | { 131 | await _userManager.SetTwoFactorEnabledAsync(user, false); 132 | await _signInManager.SignInAsync(user, isPersistent: false); 133 | _logger.LogInformation(2, "User disabled two-factor authentication."); 134 | } 135 | return RedirectToAction(nameof(Index), "Manage"); 136 | } 137 | 138 | // 139 | // GET: /Manage/VerifyPhoneNumber 140 | [HttpGet] 141 | public async Task VerifyPhoneNumber(string phoneNumber) 142 | { 143 | var code = await _userManager.GenerateChangePhoneNumberTokenAsync(await GetCurrentUserAsync(), phoneNumber); 144 | // Send an SMS to verify the phone number 145 | return phoneNumber == null ? View("Error") : View(new VerifyPhoneNumberViewModel { PhoneNumber = phoneNumber }); 146 | } 147 | 148 | // 149 | // POST: /Manage/VerifyPhoneNumber 150 | [HttpPost] 151 | [ValidateAntiForgeryToken] 152 | public async Task VerifyPhoneNumber(VerifyPhoneNumberViewModel model) 153 | { 154 | if (!ModelState.IsValid) 155 | { 156 | return View(model); 157 | } 158 | var user = await GetCurrentUserAsync(); 159 | if (user != null) 160 | { 161 | var result = await _userManager.ChangePhoneNumberAsync(user, model.PhoneNumber, model.Code); 162 | if (result.Succeeded) 163 | { 164 | await _signInManager.SignInAsync(user, isPersistent: false); 165 | return RedirectToAction(nameof(Index), new { Message = ManageMessageId.AddPhoneSuccess }); 166 | } 167 | } 168 | // If we got this far, something failed, redisplay the form 169 | ModelState.AddModelError(string.Empty, "Failed to verify phone number"); 170 | return View(model); 171 | } 172 | 173 | // 174 | // GET: /Manage/RemovePhoneNumber 175 | [HttpGet] 176 | public async Task RemovePhoneNumber() 177 | { 178 | var user = await GetCurrentUserAsync(); 179 | if (user != null) 180 | { 181 | var result = await _userManager.SetPhoneNumberAsync(user, null); 182 | if (result.Succeeded) 183 | { 184 | await _signInManager.SignInAsync(user, isPersistent: false); 185 | return RedirectToAction(nameof(Index), new { Message = ManageMessageId.RemovePhoneSuccess }); 186 | } 187 | } 188 | return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); 189 | } 190 | 191 | // 192 | // GET: /Manage/ChangePassword 193 | [HttpGet] 194 | public IActionResult ChangePassword() 195 | { 196 | return View(); 197 | } 198 | 199 | // 200 | // POST: /Manage/ChangePassword 201 | [HttpPost] 202 | [ValidateAntiForgeryToken] 203 | public async Task ChangePassword(ChangePasswordViewModel model) 204 | { 205 | if (!ModelState.IsValid) 206 | { 207 | return View(model); 208 | } 209 | var user = await GetCurrentUserAsync(); 210 | if (user != null) 211 | { 212 | var result = await _userManager.ChangePasswordAsync(user, model.OldPassword, model.NewPassword); 213 | if (result.Succeeded) 214 | { 215 | await _signInManager.SignInAsync(user, isPersistent: false); 216 | _logger.LogInformation(3, "User changed their password successfully."); 217 | return RedirectToAction(nameof(Index), new { Message = ManageMessageId.ChangePasswordSuccess }); 218 | } 219 | AddErrors(result); 220 | return View(model); 221 | } 222 | return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); 223 | } 224 | 225 | // 226 | // GET: /Manage/SetPassword 227 | [HttpGet] 228 | public IActionResult SetPassword() 229 | { 230 | return View(); 231 | } 232 | 233 | // 234 | // POST: /Manage/SetPassword 235 | [HttpPost] 236 | [ValidateAntiForgeryToken] 237 | public async Task SetPassword(SetPasswordViewModel model) 238 | { 239 | if (!ModelState.IsValid) 240 | { 241 | return View(model); 242 | } 243 | 244 | var user = await GetCurrentUserAsync(); 245 | if (user != null) 246 | { 247 | var result = await _userManager.AddPasswordAsync(user, model.NewPassword); 248 | if (result.Succeeded) 249 | { 250 | await _signInManager.SignInAsync(user, isPersistent: false); 251 | return RedirectToAction(nameof(Index), new { Message = ManageMessageId.SetPasswordSuccess }); 252 | } 253 | AddErrors(result); 254 | return View(model); 255 | } 256 | return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); 257 | } 258 | 259 | //GET: /Manage/ManageLogins 260 | [HttpGet] 261 | public async Task ManageLogins(ManageMessageId? message = null) 262 | { 263 | ViewData["StatusMessage"] = 264 | message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed." 265 | : message == ManageMessageId.AddLoginSuccess ? "The external login was added." 266 | : message == ManageMessageId.Error ? "An error has occurred." 267 | : ""; 268 | var user = await GetCurrentUserAsync(); 269 | if (user == null) 270 | { 271 | return View("Error"); 272 | } 273 | var userLogins = await _userManager.GetLoginsAsync(user); 274 | var otherLogins = _signInManager.GetExternalAuthenticationSchemes().Where(auth => userLogins.All(ul => auth.AuthenticationScheme != ul.LoginProvider)).ToList(); 275 | ViewData["ShowRemoveButton"] = user.PasswordHash != null || userLogins.Count > 1; 276 | return View(new ManageLoginsViewModel 277 | { 278 | CurrentLogins = userLogins, 279 | OtherLogins = otherLogins 280 | }); 281 | } 282 | 283 | // 284 | // POST: /Manage/LinkLogin 285 | [HttpPost] 286 | [ValidateAntiForgeryToken] 287 | public IActionResult LinkLogin(string provider) 288 | { 289 | // Request a redirect to the external login provider to link a login for the current user 290 | var redirectUrl = Url.Action("LinkLoginCallback", "Manage"); 291 | var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl, _userManager.GetUserId(User)); 292 | return new ChallengeResult(provider, properties); 293 | } 294 | 295 | // 296 | // GET: /Manage/LinkLoginCallback 297 | [HttpGet] 298 | public async Task LinkLoginCallback() 299 | { 300 | var user = await GetCurrentUserAsync(); 301 | if (user == null) 302 | { 303 | return View("Error"); 304 | } 305 | var info = await _signInManager.GetExternalLoginInfoAsync(await _userManager.GetUserIdAsync(user)); 306 | if (info == null) 307 | { 308 | return RedirectToAction(nameof(ManageLogins), new { Message = ManageMessageId.Error }); 309 | } 310 | var result = await _userManager.AddLoginAsync(user, info); 311 | var message = result.Succeeded ? ManageMessageId.AddLoginSuccess : ManageMessageId.Error; 312 | return RedirectToAction(nameof(ManageLogins), new { Message = message }); 313 | } 314 | 315 | #region Helpers 316 | 317 | private void AddErrors(IdentityResult result) 318 | { 319 | foreach (var error in result.Errors) 320 | { 321 | ModelState.AddModelError(string.Empty, error.Description); 322 | } 323 | } 324 | 325 | public enum ManageMessageId 326 | { 327 | AddPhoneSuccess, 328 | AddLoginSuccess, 329 | ChangePasswordSuccess, 330 | SetTwoFactorSuccess, 331 | SetPasswordSuccess, 332 | RemoveLoginSuccess, 333 | RemovePhoneSuccess, 334 | Error 335 | } 336 | 337 | private Task GetCurrentUserAsync() 338 | { 339 | return _userManager.GetUserAsync(HttpContext.User); 340 | } 341 | 342 | #endregion 343 | } 344 | } 345 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Migrations/00000000000000_CreateIdentitySchema.Designer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using ASP.NET_Core_SPAs.Models; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using Microsoft.EntityFrameworkCore.Metadata; 6 | using Microsoft.EntityFrameworkCore.Migrations; 7 | 8 | namespace ASP.NET_Core_SPAs.Migrations 9 | { 10 | [DbContext(typeof(ApplicationDbContext))] 11 | [Migration("00000000000000_CreateIdentitySchema")] 12 | partial class CreateIdentitySchema 13 | { 14 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 15 | { 16 | modelBuilder 17 | .HasAnnotation("ProductVersion", "7.0.0-beta8") 18 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 19 | 20 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRole", b => 21 | { 22 | b.Property("Id"); 23 | 24 | b.Property("ConcurrencyStamp") 25 | .IsConcurrencyToken(); 26 | 27 | b.Property("Name") 28 | .HasAnnotation("MaxLength", 256); 29 | 30 | b.Property("NormalizedName") 31 | .HasAnnotation("MaxLength", 256); 32 | 33 | b.HasKey("Id"); 34 | 35 | b.HasIndex("NormalizedName") 36 | .HasAnnotation("Relational:Name", "RoleNameIndex"); 37 | 38 | b.HasAnnotation("Relational:TableName", "AspNetRoles"); 39 | }); 40 | 41 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim", b => 42 | { 43 | b.Property("Id") 44 | .ValueGeneratedOnAdd(); 45 | 46 | b.Property("ClaimType"); 47 | 48 | b.Property("ClaimValue"); 49 | 50 | b.Property("RoleId"); 51 | 52 | b.HasKey("Id"); 53 | 54 | b.HasAnnotation("Relational:TableName", "AspNetRoleClaims"); 55 | }); 56 | 57 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim", b => 58 | { 59 | b.Property("Id") 60 | .ValueGeneratedOnAdd(); 61 | 62 | b.Property("ClaimType"); 63 | 64 | b.Property("ClaimValue"); 65 | 66 | b.Property("UserId"); 67 | 68 | b.HasKey("Id"); 69 | 70 | b.HasAnnotation("Relational:TableName", "AspNetUserClaims"); 71 | }); 72 | 73 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin", b => 74 | { 75 | b.Property("LoginProvider"); 76 | 77 | b.Property("ProviderKey"); 78 | 79 | b.Property("ProviderDisplayName"); 80 | 81 | b.Property("UserId"); 82 | 83 | b.HasKey("LoginProvider", "ProviderKey"); 84 | 85 | b.HasAnnotation("Relational:TableName", "AspNetUserLogins"); 86 | }); 87 | 88 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole", b => 89 | { 90 | b.Property("UserId"); 91 | 92 | b.Property("RoleId"); 93 | 94 | b.HasKey("UserId", "RoleId"); 95 | 96 | b.HasAnnotation("Relational:TableName", "AspNetUserRoles"); 97 | }); 98 | 99 | modelBuilder.Entity("ASP.NET_Core_SPAs.Models.ApplicationUser", b => 100 | { 101 | b.Property("Id"); 102 | 103 | b.Property("AccessFailedCount"); 104 | 105 | b.Property("ConcurrencyStamp") 106 | .IsConcurrencyToken(); 107 | 108 | b.Property("Email") 109 | .HasAnnotation("MaxLength", 256); 110 | 111 | b.Property("EmailConfirmed"); 112 | 113 | b.Property("LockoutEnabled"); 114 | 115 | b.Property("LockoutEnd"); 116 | 117 | b.Property("NormalizedEmail") 118 | .HasAnnotation("MaxLength", 256); 119 | 120 | b.Property("NormalizedUserName") 121 | .HasAnnotation("MaxLength", 256); 122 | 123 | b.Property("PasswordHash"); 124 | 125 | b.Property("PhoneNumber"); 126 | 127 | b.Property("PhoneNumberConfirmed"); 128 | 129 | b.Property("SecurityStamp"); 130 | 131 | b.Property("TwoFactorEnabled"); 132 | 133 | b.Property("UserName") 134 | .HasAnnotation("MaxLength", 256); 135 | 136 | b.HasKey("Id"); 137 | 138 | b.HasIndex("NormalizedEmail") 139 | .HasAnnotation("Relational:Name", "EmailIndex"); 140 | 141 | b.HasIndex("NormalizedUserName") 142 | .HasAnnotation("Relational:Name", "UserNameIndex"); 143 | 144 | b.HasAnnotation("Relational:TableName", "AspNetUsers"); 145 | }); 146 | 147 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim", b => 148 | { 149 | b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole") 150 | .WithMany() 151 | .HasForeignKey("RoleId"); 152 | }); 153 | 154 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim", b => 155 | { 156 | b.HasOne("ASP.NET_Core_SPAs.Models.ApplicationUser") 157 | .WithMany() 158 | .HasForeignKey("UserId"); 159 | }); 160 | 161 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin", b => 162 | { 163 | b.HasOne("ASP.NET_Core_SPAs.Models.ApplicationUser") 164 | .WithMany() 165 | .HasForeignKey("UserId"); 166 | }); 167 | 168 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole", b => 169 | { 170 | b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole") 171 | .WithMany() 172 | .HasForeignKey("RoleId"); 173 | 174 | b.HasOne("ASP.NET_Core_SPAs.Models.ApplicationUser") 175 | .WithMany() 176 | .HasForeignKey("UserId"); 177 | }); 178 | } 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Migrations/00000000000000_CreateIdentitySchema.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Metadata; 3 | using Microsoft.EntityFrameworkCore.Migrations; 4 | 5 | namespace ASP.NET_Core_SPAs.Migrations 6 | { 7 | public partial class CreateIdentitySchema : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.CreateTable( 12 | name: "AspNetRoles", 13 | columns: table => new 14 | { 15 | Id = table.Column(nullable: false), 16 | ConcurrencyStamp = table.Column(nullable: true), 17 | Name = table.Column(nullable: true), 18 | NormalizedName = table.Column(nullable: true) 19 | }, 20 | constraints: table => 21 | { 22 | table.PrimaryKey("PK_IdentityRole", x => x.Id); 23 | }); 24 | migrationBuilder.CreateTable( 25 | name: "AspNetUsers", 26 | columns: table => new 27 | { 28 | Id = table.Column(nullable: false), 29 | AccessFailedCount = table.Column(nullable: false), 30 | ConcurrencyStamp = table.Column(nullable: true), 31 | Email = table.Column(nullable: true), 32 | EmailConfirmed = table.Column(nullable: false), 33 | LockoutEnabled = table.Column(nullable: false), 34 | LockoutEnd = table.Column(nullable: true), 35 | NormalizedEmail = table.Column(nullable: true), 36 | NormalizedUserName = table.Column(nullable: true), 37 | PasswordHash = table.Column(nullable: true), 38 | PhoneNumber = table.Column(nullable: true), 39 | PhoneNumberConfirmed = table.Column(nullable: false), 40 | SecurityStamp = table.Column(nullable: true), 41 | TwoFactorEnabled = table.Column(nullable: false), 42 | UserName = table.Column(nullable: true) 43 | }, 44 | constraints: table => 45 | { 46 | table.PrimaryKey("PK_ApplicationUser", x => x.Id); 47 | }); 48 | migrationBuilder.CreateTable( 49 | name: "AspNetRoleClaims", 50 | columns: table => new 51 | { 52 | Id = table.Column(nullable: false) 53 | .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), 54 | ClaimType = table.Column(nullable: true), 55 | ClaimValue = table.Column(nullable: true), 56 | RoleId = table.Column(nullable: true) 57 | }, 58 | constraints: table => 59 | { 60 | table.PrimaryKey("PK_IdentityRoleClaim", x => x.Id); 61 | table.ForeignKey( 62 | name: "FK_IdentityRoleClaim_IdentityRole_RoleId", 63 | column: x => x.RoleId, 64 | principalTable: "AspNetRoles", 65 | principalColumn: "Id"); 66 | }); 67 | migrationBuilder.CreateTable( 68 | name: "AspNetUserClaims", 69 | columns: table => new 70 | { 71 | Id = table.Column(nullable: false) 72 | .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), 73 | ClaimType = table.Column(nullable: true), 74 | ClaimValue = table.Column(nullable: true), 75 | UserId = table.Column(nullable: true) 76 | }, 77 | constraints: table => 78 | { 79 | table.PrimaryKey("PK_IdentityUserClaim", x => x.Id); 80 | table.ForeignKey( 81 | name: "FK_IdentityUserClaim_ApplicationUser_UserId", 82 | column: x => x.UserId, 83 | principalTable: "AspNetUsers", 84 | principalColumn: "Id"); 85 | }); 86 | migrationBuilder.CreateTable( 87 | name: "AspNetUserLogins", 88 | columns: table => new 89 | { 90 | LoginProvider = table.Column(nullable: false), 91 | ProviderKey = table.Column(nullable: false), 92 | ProviderDisplayName = table.Column(nullable: true), 93 | UserId = table.Column(nullable: true) 94 | }, 95 | constraints: table => 96 | { 97 | table.PrimaryKey("PK_IdentityUserLogin", x => new { x.LoginProvider, x.ProviderKey }); 98 | table.ForeignKey( 99 | name: "FK_IdentityUserLogin_ApplicationUser_UserId", 100 | column: x => x.UserId, 101 | principalTable: "AspNetUsers", 102 | principalColumn: "Id"); 103 | }); 104 | migrationBuilder.CreateTable( 105 | name: "AspNetUserRoles", 106 | columns: table => new 107 | { 108 | UserId = table.Column(nullable: false), 109 | RoleId = table.Column(nullable: false) 110 | }, 111 | constraints: table => 112 | { 113 | table.PrimaryKey("PK_IdentityUserRole", x => new { x.UserId, x.RoleId }); 114 | table.ForeignKey( 115 | name: "FK_IdentityUserRole_IdentityRole_RoleId", 116 | column: x => x.RoleId, 117 | principalTable: "AspNetRoles", 118 | principalColumn: "Id"); 119 | table.ForeignKey( 120 | name: "FK_IdentityUserRole_ApplicationUser_UserId", 121 | column: x => x.UserId, 122 | principalTable: "AspNetUsers", 123 | principalColumn: "Id"); 124 | }); 125 | migrationBuilder.CreateIndex( 126 | name: "RoleNameIndex", 127 | table: "AspNetRoles", 128 | column: "NormalizedName"); 129 | migrationBuilder.CreateIndex( 130 | name: "EmailIndex", 131 | table: "AspNetUsers", 132 | column: "NormalizedEmail"); 133 | migrationBuilder.CreateIndex( 134 | name: "UserNameIndex", 135 | table: "AspNetUsers", 136 | column: "NormalizedUserName"); 137 | } 138 | 139 | protected override void Down(MigrationBuilder migrationBuilder) 140 | { 141 | migrationBuilder.DropTable("AspNetRoleClaims"); 142 | migrationBuilder.DropTable("AspNetUserClaims"); 143 | migrationBuilder.DropTable("AspNetUserLogins"); 144 | migrationBuilder.DropTable("AspNetUserRoles"); 145 | migrationBuilder.DropTable("AspNetRoles"); 146 | migrationBuilder.DropTable("AspNetUsers"); 147 | } 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Migrations/20160205214715_Init.Designer.cs: -------------------------------------------------------------------------------- 1 | using ASP.NET_Core_SPAs.Contexts; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Infrastructure; 4 | using Microsoft.EntityFrameworkCore.Metadata; 5 | using Microsoft.EntityFrameworkCore.Migrations; 6 | 7 | namespace ASP.NETCoreSPAs.Migrations 8 | { 9 | [DbContext(typeof(ContactsDbContext))] 10 | [Migration("20160205214715_Init")] 11 | partial class Init 12 | { 13 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 14 | { 15 | modelBuilder 16 | .HasAnnotation("ProductVersion", "7.0.0-rc1-16348") 17 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 18 | 19 | modelBuilder.Entity("ASP.NET_Core_SPAs.Models.Contact", b => 20 | { 21 | b.Property("Id") 22 | .ValueGeneratedOnAdd(); 23 | 24 | b.Property("EmailAddress") 25 | .HasAnnotation("MaxLength", 200); 26 | 27 | b.Property("Name") 28 | .IsRequired() 29 | .HasAnnotation("MaxLength", 200); 30 | 31 | b.Property("PhoneNumber"); 32 | 33 | b.Property("UserId"); 34 | 35 | b.HasKey("Id"); 36 | }); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Migrations/20160205214715_Init.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Metadata; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | namespace ASP.NETCoreSPAs.Migrations 5 | { 6 | public partial class Init : Migration 7 | { 8 | protected override void Up(MigrationBuilder migrationBuilder) 9 | { 10 | migrationBuilder.CreateTable( 11 | name: "Contact", 12 | columns: table => new 13 | { 14 | Id = table.Column(nullable: false) 15 | .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), 16 | EmailAddress = table.Column(nullable: true), 17 | Name = table.Column(nullable: false), 18 | PhoneNumber = table.Column(nullable: true), 19 | UserId = table.Column(nullable: true) 20 | }, 21 | constraints: table => 22 | { 23 | table.PrimaryKey("PK_Contact", x => x.Id); 24 | }); 25 | } 26 | 27 | protected override void Down(MigrationBuilder migrationBuilder) 28 | { 29 | migrationBuilder.DropTable("Contact"); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Migrations/ApplicationDbContextModelSnapshot.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using ASP.NET_Core_SPAs.Models; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using Microsoft.EntityFrameworkCore.Metadata; 6 | 7 | namespace ASP.NET_Core_SPAs.Migrations 8 | { 9 | [DbContext(typeof(ApplicationDbContext))] 10 | partial class ApplicationDbContextModelSnapshot : ModelSnapshot 11 | { 12 | protected override void BuildModel(ModelBuilder modelBuilder) 13 | { 14 | modelBuilder 15 | .HasAnnotation("ProductVersion", "7.0.0-beta8") 16 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 17 | 18 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRole", b => 19 | { 20 | b.Property("Id"); 21 | 22 | b.Property("ConcurrencyStamp") 23 | .IsConcurrencyToken(); 24 | 25 | b.Property("Name") 26 | .HasAnnotation("MaxLength", 256); 27 | 28 | b.Property("NormalizedName") 29 | .HasAnnotation("MaxLength", 256); 30 | 31 | b.HasKey("Id"); 32 | 33 | b.HasIndex("NormalizedName") 34 | .HasAnnotation("Relational:Name", "RoleNameIndex"); 35 | 36 | b.HasAnnotation("Relational:TableName", "AspNetRoles"); 37 | }); 38 | 39 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim", b => 40 | { 41 | b.Property("Id") 42 | .ValueGeneratedOnAdd(); 43 | 44 | b.Property("ClaimType"); 45 | 46 | b.Property("ClaimValue"); 47 | 48 | b.Property("RoleId"); 49 | 50 | b.HasKey("Id"); 51 | 52 | b.HasAnnotation("Relational:TableName", "AspNetRoleClaims"); 53 | }); 54 | 55 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim", b => 56 | { 57 | b.Property("Id") 58 | .ValueGeneratedOnAdd(); 59 | 60 | b.Property("ClaimType"); 61 | 62 | b.Property("ClaimValue"); 63 | 64 | b.Property("UserId"); 65 | 66 | b.HasKey("Id"); 67 | 68 | b.HasAnnotation("Relational:TableName", "AspNetUserClaims"); 69 | }); 70 | 71 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin", b => 72 | { 73 | b.Property("LoginProvider"); 74 | 75 | b.Property("ProviderKey"); 76 | 77 | b.Property("ProviderDisplayName"); 78 | 79 | b.Property("UserId"); 80 | 81 | b.HasKey("LoginProvider", "ProviderKey"); 82 | 83 | b.HasAnnotation("Relational:TableName", "AspNetUserLogins"); 84 | }); 85 | 86 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole", b => 87 | { 88 | b.Property("UserId"); 89 | 90 | b.Property("RoleId"); 91 | 92 | b.HasKey("UserId", "RoleId"); 93 | 94 | b.HasAnnotation("Relational:TableName", "AspNetUserRoles"); 95 | }); 96 | 97 | modelBuilder.Entity("ASP.NET_Core_SPAs.Models.ApplicationUser", b => 98 | { 99 | b.Property("Id"); 100 | 101 | b.Property("AccessFailedCount"); 102 | 103 | b.Property("ConcurrencyStamp") 104 | .IsConcurrencyToken(); 105 | 106 | b.Property("Email") 107 | .HasAnnotation("MaxLength", 256); 108 | 109 | b.Property("EmailConfirmed"); 110 | 111 | b.Property("LockoutEnabled"); 112 | 113 | b.Property("LockoutEnd"); 114 | 115 | b.Property("NormalizedEmail") 116 | .HasAnnotation("MaxLength", 256); 117 | 118 | b.Property("NormalizedUserName") 119 | .HasAnnotation("MaxLength", 256); 120 | 121 | b.Property("PasswordHash"); 122 | 123 | b.Property("PhoneNumber"); 124 | 125 | b.Property("PhoneNumberConfirmed"); 126 | 127 | b.Property("SecurityStamp"); 128 | 129 | b.Property("TwoFactorEnabled"); 130 | 131 | b.Property("UserName") 132 | .HasAnnotation("MaxLength", 256); 133 | 134 | b.HasKey("Id"); 135 | 136 | b.HasIndex("NormalizedEmail") 137 | .HasAnnotation("Relational:Name", "EmailIndex"); 138 | 139 | b.HasIndex("NormalizedUserName") 140 | .HasAnnotation("Relational:Name", "UserNameIndex"); 141 | 142 | b.HasAnnotation("Relational:TableName", "AspNetUsers"); 143 | }); 144 | 145 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim", b => 146 | { 147 | b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole") 148 | .WithMany() 149 | .HasForeignKey("RoleId"); 150 | }); 151 | 152 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim", b => 153 | { 154 | b.HasOne("ASP.NET_Core_SPAs.Models.ApplicationUser") 155 | .WithMany() 156 | .HasForeignKey("UserId"); 157 | }); 158 | 159 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin", b => 160 | { 161 | b.HasOne("ASP.NET_Core_SPAs.Models.ApplicationUser") 162 | .WithMany() 163 | .HasForeignKey("UserId"); 164 | }); 165 | 166 | modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole", b => 167 | { 168 | b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole") 169 | .WithMany() 170 | .HasForeignKey("RoleId"); 171 | 172 | b.HasOne("ASP.NET_Core_SPAs.Models.ApplicationUser") 173 | .WithMany() 174 | .HasForeignKey("UserId"); 175 | }); 176 | } 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Migrations/ContactsDbContextModelSnapshot.cs: -------------------------------------------------------------------------------- 1 | using ASP.NET_Core_SPAs.Contexts; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Infrastructure; 4 | using Microsoft.EntityFrameworkCore.Metadata; 5 | 6 | namespace ASP.NETCoreSPAs.Migrations 7 | { 8 | [DbContext(typeof(ContactsDbContext))] 9 | partial class ContactsDbContextModelSnapshot : ModelSnapshot 10 | { 11 | protected override void BuildModel(ModelBuilder modelBuilder) 12 | { 13 | modelBuilder 14 | .HasAnnotation("ProductVersion", "7.0.0-rc1-16348") 15 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 16 | 17 | modelBuilder.Entity("ASP.NET_Core_SPAs.Models.Contact", b => 18 | { 19 | b.Property("Id") 20 | .ValueGeneratedOnAdd(); 21 | 22 | b.Property("EmailAddress") 23 | .HasAnnotation("MaxLength", 200); 24 | 25 | b.Property("Name") 26 | .IsRequired() 27 | .HasAnnotation("MaxLength", 200); 28 | 29 | b.Property("PhoneNumber"); 30 | 31 | b.Property("UserId"); 32 | 33 | b.HasKey("Id"); 34 | }); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Models/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace ASP.NET_Core_SPAs.Models 5 | { 6 | public class ApplicationDbContext : IdentityDbContext 7 | { 8 | public ApplicationDbContext(DbContextOptions options) 9 | : base(options) 10 | { 11 | } 12 | 13 | protected override void OnModelCreating(ModelBuilder builder) 14 | { 15 | base.OnModelCreating(builder); 16 | // Customize the ASP.NET Identity model and override the defaults if needed. 17 | // For example, you can rename the ASP.NET Identity table names and more. 18 | // Add your customizations after calling base.OnModelCreating(builder); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Models/ApplicationUser.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 2 | 3 | namespace ASP.NET_Core_SPAs.Models 4 | { 5 | // Add profile data for application users by adding properties to the ApplicationUser class 6 | public class ApplicationUser : IdentityUser 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Models/Contact.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace ASP.NET_Core_SPAs.Models 4 | { 5 | public class Contact 6 | { 7 | public int Id { get; set; } 8 | public string UserId { get; set; } 9 | [Required] 10 | [MinLength(1)] 11 | [MaxLength(200)] 12 | public string Name { get; set; } 13 | [EmailAddress] 14 | [MinLength(1)] 15 | [MaxLength(200)] 16 | [Display(Name="Email")] 17 | public string EmailAddress { get; set; } 18 | [Display(Name="Phone")] 19 | public string PhoneNumber { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Program.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace ASP.NET_Core_SPAs 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | var host = new WebHostBuilder() 11 | .UseKestrel() 12 | .UseContentRoot(Directory.GetCurrentDirectory()) 13 | .UseIISIntegration() 14 | .UseStartup() 15 | .Build(); 16 | 17 | host.Run(); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Project_Readme.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Welcome to ASP.NET 5 6 | 127 | 128 | 129 | 130 | 138 | 139 |
140 |
141 |

This application consists of:

142 |
    143 |
  • Sample pages using ASP.NET MVC 6
  • 144 |
  • Gulp and Bower for managing client-side libraries
  • 145 |
  • Theming using Bootstrap
  • 146 |
147 |
148 | 160 | 172 | 181 | 182 | 185 |
186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:6555/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "web": { 19 | "commandName": "web", 20 | "environmentVariables": { 21 | "ASPNETCORE_ENVIRONMENT": "Development" 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Services/IEmailSender.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace ASP.NET_Core_SPAs.Services 7 | { 8 | public interface IEmailSender 9 | { 10 | Task SendEmailAsync(string email, string subject, string message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Services/ISmsSender.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace ASP.NET_Core_SPAs.Services 7 | { 8 | public interface ISmsSender 9 | { 10 | Task SendSmsAsync(string number, string message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Services/MessageServices.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace ASP.NET_Core_SPAs.Services 7 | { 8 | // This class is used by the application to send Email and SMS 9 | // when you turn on two-factor authentication in ASP.NET Identity. 10 | // For more details see this link http://go.microsoft.com/fwlink/?LinkID=532713 11 | public class AuthMessageSender : IEmailSender, ISmsSender 12 | { 13 | public Task SendEmailAsync(string email, string subject, string message) 14 | { 15 | // Plug in your email service here to send an email. 16 | return Task.FromResult(0); 17 | } 18 | 19 | public Task SendSmsAsync(string number, string message) 20 | { 21 | // Plug in your SMS service here to send a text message. 22 | return Task.FromResult(0); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore; 5 | using Microsoft.Extensions.Configuration; 6 | using Microsoft.Extensions.DependencyInjection; 7 | using Microsoft.Extensions.Logging; 8 | using ASP.NET_Core_SPAs.Contexts; 9 | using ASP.NET_Core_SPAs.Models; 10 | using ASP.NET_Core_SPAs.Services; 11 | using Newtonsoft.Json.Serialization; 12 | 13 | namespace ASP.NET_Core_SPAs 14 | { 15 | public class Startup 16 | { 17 | public Startup(IHostingEnvironment env) 18 | { 19 | var builder = new ConfigurationBuilder() 20 | .SetBasePath(env.ContentRootPath) 21 | .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) 22 | .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true); 23 | 24 | if (env.IsDevelopment()) 25 | { 26 | // For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709 27 | builder.AddUserSecrets(); 28 | } 29 | 30 | builder.AddEnvironmentVariables(); 31 | Configuration = builder.Build(); 32 | } 33 | 34 | public IConfigurationRoot Configuration { get; set; } 35 | 36 | // This method gets called by the runtime. Use this method to add services to the container. 37 | public void ConfigureServices(IServiceCollection services) 38 | { 39 | // Add framework services. 40 | services.AddDbContext(options => 41 | options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); 42 | services.AddDbContext(options => 43 | options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); 44 | 45 | services.AddIdentity() 46 | .AddEntityFrameworkStores() 47 | .AddDefaultTokenProviders(); 48 | 49 | services.AddMvc() 50 | .AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver()); 51 | 52 | // Add application services. 53 | services.AddTransient(); 54 | services.AddTransient(); 55 | } 56 | 57 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 58 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 59 | { 60 | loggerFactory.AddConsole(Configuration.GetSection("Logging")); 61 | loggerFactory.AddDebug(); 62 | 63 | if (env.IsDevelopment()) 64 | { 65 | app.UseDeveloperExceptionPage(); 66 | app.UseDatabaseErrorPage(); 67 | app.UseBrowserLink(); 68 | } 69 | else 70 | { 71 | app.UseExceptionHandler("/Home/Error"); 72 | } 73 | 74 | 75 | app.UseStaticFiles(); 76 | 77 | app.UseIdentity(); 78 | 79 | // To configure external authentication please see http://go.microsoft.com/fwlink/?LinkID=532715 80 | app.UseMvc(routes => 81 | { 82 | routes.MapRoute( 83 | name: "default", 84 | template: "{controller=Home}/{action=Index}/{id?}"); 85 | }); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Account/ExternalLoginConfirmationViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace ASP.NET_Core_SPAs.ViewModels.Account 8 | { 9 | public class ExternalLoginConfirmationViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Account/ForgotPasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace ASP.NET_Core_SPAs.ViewModels.Account 8 | { 9 | public class ForgotPasswordViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Account/LoginViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace ASP.NET_Core_SPAs.ViewModels.Account 8 | { 9 | public class LoginViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | 15 | [Required] 16 | [DataType(DataType.Password)] 17 | public string Password { get; set; } 18 | 19 | [Display(Name = "Remember me?")] 20 | public bool RememberMe { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Account/RegisterViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace ASP.NET_Core_SPAs.ViewModels.Account 8 | { 9 | public class RegisterViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | [Display(Name = "Email")] 14 | public string Email { get; set; } 15 | 16 | [Required] 17 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 18 | [DataType(DataType.Password)] 19 | [Display(Name = "Password")] 20 | public string Password { get; set; } 21 | 22 | [DataType(DataType.Password)] 23 | [Display(Name = "Confirm password")] 24 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 25 | public string ConfirmPassword { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Account/ResetPasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace ASP.NET_Core_SPAs.ViewModels.Account 8 | { 9 | public class ResetPasswordViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | 15 | [Required] 16 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 17 | [DataType(DataType.Password)] 18 | public string Password { get; set; } 19 | 20 | [DataType(DataType.Password)] 21 | [Display(Name = "Confirm password")] 22 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 23 | public string ConfirmPassword { get; set; } 24 | 25 | public string Code { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Account/SendCodeViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.AspNetCore.Mvc.Rendering; 3 | 4 | namespace ASP.NET_Core_SPAs.ViewModels.Account 5 | { 6 | public class SendCodeViewModel 7 | { 8 | public string SelectedProvider { get; set; } 9 | 10 | public ICollection Providers { get; set; } 11 | 12 | public string ReturnUrl { get; set; } 13 | 14 | public bool RememberMe { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Account/VerifyCodeViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace ASP.NET_Core_SPAs.ViewModels.Account 8 | { 9 | public class VerifyCodeViewModel 10 | { 11 | [Required] 12 | public string Provider { get; set; } 13 | 14 | [Required] 15 | public string Code { get; set; } 16 | 17 | public string ReturnUrl { get; set; } 18 | 19 | [Display(Name = "Remember this browser?")] 20 | public bool RememberBrowser { get; set; } 21 | 22 | [Display(Name = "Remember me?")] 23 | public bool RememberMe { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Manage/AddPhoneNumberViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace ASP.NET_Core_SPAs.ViewModels.Manage 8 | { 9 | public class AddPhoneNumberViewModel 10 | { 11 | [Required] 12 | [Phone] 13 | [Display(Name = "Phone number")] 14 | public string PhoneNumber { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Manage/ChangePasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace ASP.NET_Core_SPAs.ViewModels.Manage 8 | { 9 | public class ChangePasswordViewModel 10 | { 11 | [Required] 12 | [DataType(DataType.Password)] 13 | [Display(Name = "Current password")] 14 | public string OldPassword { get; set; } 15 | 16 | [Required] 17 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 18 | [DataType(DataType.Password)] 19 | [Display(Name = "New password")] 20 | public string NewPassword { get; set; } 21 | 22 | [DataType(DataType.Password)] 23 | [Display(Name = "Confirm new password")] 24 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] 25 | public string ConfirmPassword { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Manage/ConfigureTwoFactorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.AspNetCore.Mvc.Rendering; 3 | 4 | namespace ASP.NET_Core_SPAs.ViewModels.Manage 5 | { 6 | public class ConfigureTwoFactorViewModel 7 | { 8 | public string SelectedProvider { get; set; } 9 | 10 | public ICollection Providers { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Manage/FactorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace ASP.NET_Core_SPAs.ViewModels.Manage 7 | { 8 | public class FactorViewModel 9 | { 10 | public string Purpose { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Manage/IndexViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.AspNetCore.Identity; 3 | 4 | namespace ASP.NET_Core_SPAs.ViewModels.Manage 5 | { 6 | public class IndexViewModel 7 | { 8 | public bool HasPassword { get; set; } 9 | 10 | public IList Logins { get; set; } 11 | 12 | public string PhoneNumber { get; set; } 13 | 14 | public bool TwoFactor { get; set; } 15 | 16 | public bool BrowserRemembered { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Manage/ManageLoginsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.AspNetCore.Http.Authentication; 3 | using Microsoft.AspNetCore.Identity; 4 | 5 | namespace ASP.NET_Core_SPAs.ViewModels.Manage 6 | { 7 | public class ManageLoginsViewModel 8 | { 9 | public IList CurrentLogins { get; set; } 10 | 11 | public IList OtherLogins { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Manage/RemoveLoginViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace ASP.NET_Core_SPAs.ViewModels.Manage 8 | { 9 | public class RemoveLoginViewModel 10 | { 11 | public string LoginProvider { get; set; } 12 | public string ProviderKey { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Manage/SetPasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace ASP.NET_Core_SPAs.ViewModels.Manage 8 | { 9 | public class SetPasswordViewModel 10 | { 11 | [Required] 12 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 13 | [DataType(DataType.Password)] 14 | [Display(Name = "New password")] 15 | public string NewPassword { get; set; } 16 | 17 | [DataType(DataType.Password)] 18 | [Display(Name = "Confirm new password")] 19 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] 20 | public string ConfirmPassword { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/ViewModels/Manage/VerifyPhoneNumberViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace ASP.NET_Core_SPAs.ViewModels.Manage 8 | { 9 | public class VerifyPhoneNumberViewModel 10 | { 11 | [Required] 12 | public string Code { get; set; } 13 | 14 | [Required] 15 | [Phone] 16 | [Display(Name = "Phone number")] 17 | public string PhoneNumber { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Account/ConfirmEmail.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Confirm Email"; 3 | } 4 | 5 |

@ViewData["Title"].

6 |
7 |

8 | Thank you for confirming your email. Please Click here to Log in. 9 |

10 |
11 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Account/ExternalLoginConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @model ExternalLoginConfirmationViewModel 2 | @{ 3 | ViewData["Title"] = "Register"; 4 | } 5 | 6 |

@ViewData["Title"].

7 |

Associate your @ViewData["LoginProvider"] account.

8 | 9 |
10 |

Association Form

11 |
12 |
13 | 14 |

15 | You've successfully authenticated with @ViewData["LoginProvider"]. 16 | Please enter a user name for this site below and click the Register button to finish 17 | logging in. 18 |

19 |
20 | 21 |
22 | 23 | 24 |
25 |
26 |
27 |
28 | 29 |
30 |
31 |
32 | 33 | @section Scripts { 34 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 35 | } 36 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Account/ExternalLoginFailure.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Login Failure"; 3 | } 4 | 5 |
6 |

@ViewData["Title"].

7 |

Unsuccessful login with service.

8 |
9 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Account/ForgotPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ForgotPasswordViewModel 2 | @{ 3 | ViewData["Title"] = "Forgot your password?"; 4 | } 5 | 6 |

@ViewData["Title"].

7 |

8 | For more information on how to enable reset password please see this article. 9 |

10 | 11 | @*
12 |

Enter your email.

13 |
14 |
15 |
16 | 17 |
18 | 19 | 20 |
21 |
22 |
23 |
24 | 25 |
26 |
27 |
*@ 28 | 29 | @section Scripts { 30 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 31 | } 32 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Account/ForgotPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Forgot Password Confirmation"; 3 | } 4 | 5 |

@ViewData["Title"].

6 |

7 | Please check your email to reset your password. 8 |

9 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Account/Lockout.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Locked out"; 3 | } 4 | 5 |
6 |

Locked out.

7 |

This account has been locked out, please try again later.

8 |
9 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Account/Login.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Collections.Generic 2 | @using Microsoft.AspNetCore.Http 3 | @using Microsoft.AspNetCore.Http.Authentication 4 | @model LoginViewModel 5 | @inject SignInManager SignInManager 6 | 7 | @{ 8 | ViewData["Title"] = "Log in"; 9 | } 10 | 11 |

@ViewData["Title"].

12 |
13 |
14 |
15 |
16 |

Use a local account to log in.

17 |
18 |
19 |
20 | 21 |
22 | 23 | 24 |
25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 |
33 |
34 |
35 |
36 | 37 | 38 |
39 |
40 |
41 |
42 |
43 | 44 |
45 |
46 |

47 | Register as a new user? 48 |

49 |

50 | Forgot your password? 51 |

52 |
53 |
54 |
55 |
56 |
57 |

Use another service to log in.

58 |
59 | @{ 60 | var loginProviders = SignInManager.GetExternalAuthenticationSchemes().ToList(); 61 | if (loginProviders.Count == 0) 62 | { 63 |
64 |

65 | There are no external authentication services configured. See this article 66 | for details on setting up this ASP.NET application to support logging in via external services. 67 |

68 |
69 | } 70 | else 71 | { 72 |
73 |
74 |

75 | @foreach (var provider in loginProviders) 76 | { 77 | 78 | } 79 |

80 |
81 |
82 | } 83 | } 84 |
85 |
86 |
87 | 88 | @section Scripts { 89 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 90 | } 91 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Account/Register.cshtml: -------------------------------------------------------------------------------- 1 | @model RegisterViewModel 2 | @{ 3 | ViewData["Title"] = "Register"; 4 | } 5 | 6 |

@ViewData["Title"].

7 | 8 |
9 |

Create a new account.

10 |
11 |
12 |
13 | 14 |
15 | 16 | 17 |
18 |
19 |
20 | 21 |
22 | 23 | 24 |
25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 |
33 |
34 |
35 | 36 |
37 |
38 |
39 | 40 | @section Scripts { 41 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 42 | } 43 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Account/ResetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ResetPasswordViewModel 2 | @{ 3 | ViewData["Title"] = "Reset password"; 4 | } 5 | 6 |

@ViewData["Title"].

7 | 8 |
9 |

Reset your password.

10 |
11 |
12 | 13 |
14 | 15 |
16 | 17 | 18 |
19 |
20 |
21 | 22 |
23 | 24 | 25 |
26 |
27 |
28 | 29 |
30 | 31 | 32 |
33 |
34 |
35 |
36 | 37 |
38 |
39 |
40 | 41 | @section Scripts { 42 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 43 | } 44 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Account/ResetPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Reset password confirmation"; 3 | } 4 | 5 |

@ViewData["Title"].

6 |

7 | Your password has been reset. Please Click here to log in. 8 |

9 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Account/SendCode.cshtml: -------------------------------------------------------------------------------- 1 | @model SendCodeViewModel 2 | @{ 3 | ViewData["Title"] = "Send Verification Code"; 4 | } 5 | 6 |

@ViewData["Title"].

7 | 8 |
9 | 10 |
11 |
12 | Select Two-Factor Authentication Provider: 13 | 14 | 15 |
16 |
17 |
18 | 19 | @section Scripts { 20 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 21 | } 22 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Account/VerifyCode.cshtml: -------------------------------------------------------------------------------- 1 | @model VerifyCodeViewModel 2 | @{ 3 | ViewData["Title"] = "Verify"; 4 | } 5 | 6 |

@ViewData["Title"].

7 | 8 |
9 |
10 | 11 | 12 |

@ViewData["Status"]

13 |
14 |
15 | 16 |
17 | 18 | 19 |
20 |
21 |
22 |
23 |
24 | 25 | 26 |
27 |
28 |
29 |
30 |
31 | 32 |
33 |
34 |
35 | 36 | @section Scripts { 37 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 38 | } 39 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Contacts/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET_Core_SPAs.Models.Contact 2 | 3 | @{ 4 | ViewData["Title"] = "Create"; 5 | } 6 | 7 |

Create

8 | 9 |
10 |
11 |

Contact

12 |
13 |
14 |
15 | 16 |
17 | 18 | 19 |
20 |
21 |
22 | 23 |
24 | 25 | 26 |
27 |
28 |
29 | 30 |
31 | 32 | 33 |
34 |
35 |
36 |
37 | 38 |
39 |
40 |
41 |
42 | 43 |
44 | Back to List 45 |
46 | 47 | @section Scripts { 48 | 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Contacts/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET_Core_SPAs.Models.Contact 2 | 3 | @{ 4 | ViewData["Title"] = "Delete"; 5 | } 6 | 7 |

Delete

8 | 9 |

Are you sure you want to delete this?

10 |
11 |

Contact

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.Name) 16 |
17 |
18 | @Html.DisplayFor(model => model.Name) 19 |
20 |
21 | @Html.DisplayNameFor(model => model.EmailAddress) 22 |
23 |
24 | @Html.DisplayFor(model => model.EmailAddress) 25 |
26 |
27 | @Html.DisplayNameFor(model => model.PhoneNumber) 28 |
29 |
30 | @Html.DisplayFor(model => model.PhoneNumber) 31 |
32 |
33 | 34 |
35 |
36 | | 37 | Back to List 38 |
39 |
40 |
41 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Contacts/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET_Core_SPAs.Models.Contact 2 | 3 | @{ 4 | ViewData["Title"] = "Details"; 5 | } 6 | 7 |

Details

8 | 9 |
10 |

Contact

11 |
12 |
13 |
14 | @Html.DisplayNameFor(model => model.Name) 15 |
16 |
17 | @Html.DisplayFor(model => model.Name) 18 |
19 |
20 | @Html.DisplayNameFor(model => model.EmailAddress) 21 |
22 |
23 | @Html.DisplayFor(model => model.EmailAddress) 24 |
25 |
26 | @Html.DisplayNameFor(model => model.PhoneNumber) 27 |
28 |
29 | @Html.DisplayFor(model => model.PhoneNumber) 30 |
31 |
32 |
33 |

34 | Edit | 35 | Back to List 36 |

37 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Contacts/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET_Core_SPAs.Models.Contact 2 | 3 | @{ 4 | ViewData["Title"] = "Edit"; 5 | } 6 | 7 |

Edit

8 | 9 |
10 |
11 |

Contact

12 |
13 |
14 | 15 | 16 |
17 | 18 |
19 | 20 | 21 |
22 |
23 |
24 | 25 |
26 | 27 | 28 |
29 |
30 |
31 | 32 |
33 | 34 | 35 |
36 |
37 |
38 |
39 | 40 |
41 |
42 |
43 |
44 | 45 |
46 | Back to List 47 |
48 | 49 | @section Scripts { 50 | 51 | 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Contacts/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewData["Title"] = "Index"; 5 | } 6 | 7 |

Index

8 | 9 |

10 | Create New 11 |

12 | 13 | 14 | 17 | 20 | 23 | 24 | 25 | 26 | @foreach (var item in Model) { 27 | 28 | 31 | 34 | 37 | 42 | 43 | } 44 |
15 | @Html.DisplayNameFor(model => model.Name) 16 | 18 | @Html.DisplayNameFor(model => model.EmailAddress) 19 | 21 | @Html.DisplayNameFor(model => model.PhoneNumber) 22 |
29 | @Html.DisplayFor(modelItem => item.Name) 30 | 32 | @Html.DisplayFor(modelItem => item.EmailAddress) 33 | 35 | @Html.DisplayFor(modelItem => item.PhoneNumber) 36 | 38 | Edit | 39 | Details | 40 | Delete 41 |
45 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Home/Angular2.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | Angular 2 QuickStart 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | Loading... 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Home/Aurelia.cshtml: -------------------------------------------------------------------------------- 1 | 
2 | 3 | 4 | 7 |
8 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 | 67 | 68 | 111 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Manage/AddPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model AddPhoneNumberViewModel 2 | @{ 3 | ViewData["Title"] = "Add Phone Number"; 4 | } 5 | 6 |

@ViewData["Title"].

7 |
8 |

Add a phone number.

9 |
10 |
11 |
12 | 13 |
14 | 15 | 16 |
17 |
18 |
19 |
20 | 21 |
22 |
23 |
24 | 25 | @section Scripts { 26 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 27 | } 28 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Manage/ChangePassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ChangePasswordViewModel 2 | @{ 3 | ViewData["Title"] = "Change Password"; 4 | } 5 | 6 |

@ViewData["Title"].

7 | 8 |
9 |

Change Password Form

10 |
11 |
12 |
13 | 14 |
15 | 16 | 17 |
18 |
19 |
20 | 21 |
22 | 23 | 24 |
25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 |
33 |
34 |
35 | 36 |
37 |
38 |
39 | 40 | @section Scripts { 41 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 42 | } 43 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Manage/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IndexViewModel 2 | @{ 3 | ViewData["Title"] = "Manage your account"; 4 | } 5 | 6 |

@ViewData["Title"].

7 |

@ViewData["StatusMessage"]

8 |
9 |

Change your account settings

10 |
11 |
12 |
Password:
13 |
14 | [ 15 | @if (Model.HasPassword) 16 | { 17 | Change 18 | } 19 | else 20 | { 21 | Create 22 | } 23 | ] 24 |
25 |
External Logins:
26 |
27 | 28 | @Model.Logins.Count [Manage] 29 |
30 | 31 | 32 |
Phone Number:
33 |
34 |

35 | Phone Numbers can used as a second factor of verification in two-factor authentication. 36 | See this article 37 | for details on setting up this ASP.NET application to support two-factor authentication using SMS. 38 |

39 | @*@(Model.PhoneNumber ?? "None") [ 40 | @if (Model.PhoneNumber != null) 41 | { 42 | Change 43 | @:  |  44 | Remove 45 | } 46 | else 47 | { 48 | Add 49 | } 50 | ]*@ 51 |
52 | 53 |
Two-Factor Authentication:
54 |
55 |

56 | There are no two-factor authentication providers configured. See this article 57 | for setting up this application to support two-factor authentication. 58 |

59 | @*@if (Model.TwoFactor) 60 | { 61 |
62 | 63 | Enabled 64 | 65 | 66 |
67 | } 68 | else 69 | { 70 |
71 | 72 | Disabled 73 | 74 | 75 |
76 | }*@ 77 |
78 |
79 |
80 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Manage/ManageLogins.cshtml: -------------------------------------------------------------------------------- 1 | @model ManageLoginsViewModel 2 | @using Microsoft.AspNetCore.Http.Authentication 3 | @{ 4 | ViewData["Title"] = "Manage your external logins"; 5 | } 6 | 7 |

@ViewData["Title"].

8 | 9 |

@ViewData["StatusMessage"]

10 | @if (Model.CurrentLogins.Count > 0) 11 | { 12 |

Registered Logins

13 | 14 | 15 | @for (var index = 0; index < Model.CurrentLogins.Count; index++) 16 | { 17 | 18 | 19 | 35 | 36 | } 37 | 38 |
@Model.CurrentLogins[index].LoginProvider 20 | @if ((bool)ViewData["ShowRemoveButton"]) 21 | { 22 |
23 |
24 | 25 | 26 | 27 |
28 |
29 | } 30 | else 31 | { 32 | @:   33 | } 34 |
39 | } 40 | @if (Model.OtherLogins.Count > 0) 41 | { 42 |

Add another service to log in.

43 |
44 |
45 |
46 |

47 | @foreach (var provider in Model.OtherLogins) 48 | { 49 | 50 | } 51 |

52 |
53 |
54 | } 55 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Manage/SetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model SetPasswordViewModel 2 | @{ 3 | ViewData["Title"] = "Set Password"; 4 | } 5 | 6 |

7 | You do not have a local username/password for this site. Add a local 8 | account so you can log in without an external login. 9 |

10 | 11 |
12 |

Set your password

13 |
14 |
15 |
16 | 17 |
18 | 19 | 20 |
21 |
22 |
23 | 24 |
25 | 26 | 27 |
28 |
29 |
30 |
31 | 32 |
33 |
34 |
35 | 36 | @section Scripts { 37 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 38 | } 39 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Manage/VerifyPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model VerifyPhoneNumberViewModel 2 | @{ 3 | ViewData["Title"] = "Verify Phone Number"; 4 | } 5 | 6 |

@ViewData["Title"].

7 | 8 |
9 | 10 |

Add a phone number.

11 |
@ViewData["Status"]
12 |
13 |
14 |
15 | 16 |
17 | 18 | 19 |
20 |
21 |
22 |
23 | 24 |
25 |
26 |
27 | 28 | @section Scripts { 29 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 30 | } 31 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Error"; 3 | } 4 | 5 |

Error.

6 |

An error occurred while processing your request.

7 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - ASP.NET_Core_SPAs 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 42 |
43 | @RenderBody() 44 |
45 |
46 |

© 2016 - ASP.NET_Core_SPAs

47 |
48 |
49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 60 | 64 | 65 | 66 | 67 | @RenderSection("scripts", required: false) 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Identity 2 | 3 | @inject SignInManager SignInManager 4 | @inject UserManager UserManager 5 | 6 | @if (SignInManager.IsSignedIn(User)) 7 | { 8 | 18 | } 19 | else 20 | { 21 | 25 | } 26 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using ASP.NET_Core_SPAs 2 | @using ASP.NET_Core_SPAs.Models 3 | @using ASP.NET_Core_SPAs.ViewModels.Account 4 | @using ASP.NET_Core_SPAs.ViewModels.Manage 5 | @using Microsoft.AspNetCore.Identity 6 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 7 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet5-ASP.NET_Core_SPAs-28d83295-2e4e-48a5-a9ff-15f099e71faa;Trusted_Connection=True;MultipleActiveResultSets=true" 4 | }, 5 | "Logging": { 6 | "IncludeScopes": false, 7 | "LogLevel": { 8 | "Default": "Debug", 9 | "System": "Information", 10 | "Microsoft": "Information" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ASP.NET", 3 | "private": true, 4 | "dependencies": { 5 | "bootstrap": "3.3.5", 6 | "jquery": "2.1.4", 7 | "jquery-validation": "1.14.0", 8 | "jquery-validation-unobtrusive": "3.2.4" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/gulpfile.js: -------------------------------------------------------------------------------- 1 | /// 2 | "use strict"; 3 | 4 | var gulp = require("gulp"), 5 | rimraf = require("rimraf"), 6 | concat = require("gulp-concat"), 7 | cssmin = require("gulp-cssmin"), 8 | uglify = require("gulp-uglify"); 9 | 10 | var paths = { 11 | webroot: "./wwwroot/" 12 | }; 13 | 14 | paths.js = paths.webroot + "js/**/*.js"; 15 | paths.minJs = paths.webroot + "js/**/*.min.js"; 16 | paths.css = paths.webroot + "css/**/*.css"; 17 | paths.minCss = paths.webroot + "css/**/*.min.css"; 18 | paths.concatJsDest = paths.webroot + "js/site.min.js"; 19 | paths.concatCssDest = paths.webroot + "css/site.min.css"; 20 | 21 | gulp.task("clean:js", function (cb) { 22 | rimraf(paths.concatJsDest, cb); 23 | }); 24 | 25 | gulp.task("clean:css", function (cb) { 26 | rimraf(paths.concatCssDest, cb); 27 | }); 28 | 29 | gulp.task("clean", ["clean:js", "clean:css"]); 30 | 31 | gulp.task("min:js", function () { 32 | return gulp.src([paths.js, "!" + paths.minJs], { base: "." }) 33 | .pipe(concat(paths.concatJsDest)) 34 | .pipe(uglify()) 35 | .pipe(gulp.dest(".")); 36 | }); 37 | 38 | gulp.task("min:css", function () { 39 | return gulp.src([paths.css, "!" + paths.minCss]) 40 | .pipe(concat(paths.concatCssDest)) 41 | .pipe(cssmin()) 42 | .pipe(gulp.dest(".")); 43 | }); 44 | 45 | gulp.task("min", ["min:js", "min:css"]); 46 | 47 | gulp.task("angular2:moveLibs", function () { 48 | return gulp.src([ 49 | "node_modules/@angular/common/**/*", 50 | "node_modules/@angular/compiler/**/*", 51 | "node_modules/@angular/core/**/*", 52 | "node_modules/@angular/http/**/*", 53 | "node_modules/@angular/platform-browser/**/*", 54 | "node_modules/@angular/platform-browser-dynamic/**/*", 55 | "node_modules/@angular/router/**/*", 56 | "node_modules/@angular/router-deprecated/**/*", 57 | "node_modules/@angular/upgrade/**/*", 58 | "node_modules/systemjs/dist/system.src.js", 59 | "node_modules/systemjs/dist/system-polyfills.js", 60 | "node_modules/rxjs/**/*", 61 | "node_modules/es6-shim/es6-shim.min.js", 62 | "node_modules/zone.js/dist/zone.js", 63 | "node_modules/reflect-metadata/Reflect.js" 64 | ], 65 | { base: "node_modules" }) 66 | .pipe(gulp.dest(paths.webroot + "Angular/lib")); 67 | 68 | }); 69 | 70 | gulp.task("angular2:moveJs", function () { 71 | return gulp.src(["Angular/**/*.js"]) 72 | .pipe(gulp.dest(paths.webroot + "Angular/app/")); 73 | 74 | }); 75 | 76 | gulp.task("angular2", ["angular2:moveLibs", "angular2:moveJs"]) -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "module": "system", 5 | "experimentalDecorators": true 6 | } 7 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ASP.NET", 3 | "version": "0.0.0", 4 | "dependencies": { 5 | "@angular/common": "2.0.0-rc.4", 6 | "@angular/compiler": "2.0.0-rc.4", 7 | "@angular/core": "2.0.0-rc.4", 8 | "@angular/http": "2.0.0-rc.4", 9 | "@angular/platform-browser": "2.0.0-rc.4", 10 | "@angular/platform-browser-dynamic": "2.0.0-rc.4", 11 | "@angular/router": "3.0.0-beta.1", 12 | "@angular/router-deprecated": "2.0.0-rc.2", 13 | "@angular/upgrade": "2.0.0-rc.4", 14 | "systemjs": "0.19.27", 15 | "es6-shim": "^0.35.0", 16 | "reflect-metadata": "^0.1.3", 17 | "rxjs": "5.0.0-beta.6", 18 | "zone.js": "^0.6.12" 19 | }, 20 | "devDependencies": { 21 | "es6-module-loader": "^0.17.8", 22 | "gulp": "3.8.11", 23 | "gulp-concat": "2.5.2", 24 | "gulp-cssmin": "0.1.7", 25 | "gulp-uglify": "1.2.0", 26 | "rimraf": "2.2.8", 27 | "jspm": "0.16.15", 28 | "typings": "^0.6.8" 29 | }, 30 | "jspm": { 31 | "directories": { 32 | "baseURL": "wwwroot" 33 | }, 34 | "dependencies": { 35 | "aurelia-animator-css": "npm:aurelia-animator-css@^1.0.0-rc.1.0.0", 36 | "aurelia-bootstrapper": "npm:aurelia-bootstrapper@^1.0.0-rc.1.0.1", 37 | "aurelia-fetch-client": "npm:aurelia-fetch-client@^1.0.0-rc.1.0.1", 38 | "aurelia-framework": "npm:aurelia-framework@^1.0.0-rc.1.0.2", 39 | "aurelia-history-browser": "npm:aurelia-history-browser@^1.0.0-rc.1.0.0", 40 | "aurelia-loader-default": "npm:aurelia-loader-default@^1.0.0-rc.1.0.0", 41 | "aurelia-logging-console": "npm:aurelia-logging-console@^1.0.0-rc.1.0.0", 42 | "aurelia-pal-browser": "npm:aurelia-pal-browser@^1.0.0-rc.1.0.1", 43 | "aurelia-polyfills": "npm:aurelia-polyfills@^1.0.0-rc.1.0.0", 44 | "aurelia-router": "npm:aurelia-router@^1.0.0-rc.1.0.1", 45 | "aurelia-templating-binding": "npm:aurelia-templating-binding@^1.0.0-rc.1.0.1", 46 | "aurelia-templating-resources": "npm:aurelia-templating-resources@^1.0.0-rc.1.0.1", 47 | "aurelia-templating-router": "npm:aurelia-templating-router@^1.0.0-rc.1.0.1", 48 | "bootstrap": "github:twbs/bootstrap@^3.3.6", 49 | "fetch": "github:github/fetch@^1.0.0", 50 | "font-awesome": "npm:font-awesome@4.6.3", 51 | "text": "github:systemjs/plugin-text@^0.0.8" 52 | }, 53 | "devDependencies": { 54 | "babel": "npm:babel-core@^5.8.38", 55 | "babel-runtime": "npm:babel-runtime@^5.8.38", 56 | "core-js": "npm:core-js@^2.4.1" 57 | }, 58 | "overrides": { 59 | "npm:core-js@2.3.0": { 60 | "main": "client/shim.min" 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "userSecretsId": "aspnet5-ASP.NET_Core_SPAs-28d83295-2e4e-48a5-a9ff-15f099e71faa", 3 | 4 | "dependencies": { 5 | "Microsoft.NETCore.App": { 6 | "version": "1.0.0", 7 | "type": "platform" 8 | }, 9 | "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", 10 | "Microsoft.AspNetCore.Diagnostics": "1.0.0", 11 | "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0", 12 | "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0", 13 | "Microsoft.AspNetCore.Mvc": "1.0.0", 14 | "Microsoft.AspNetCore.Razor.Tools": { 15 | "version": "1.0.0-preview1-final", 16 | "type": "build" 17 | }, 18 | "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", 19 | "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", 20 | "Microsoft.AspNetCore.StaticFiles": "1.0.0", 21 | "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0", 22 | "Microsoft.EntityFrameworkCore.Tools": { 23 | "version": "1.0.0-preview2-final", 24 | "type": "build" 25 | }, 26 | "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", 27 | "Microsoft.Extensions.Configuration.Json": "1.0.0", 28 | "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0", 29 | "Microsoft.Extensions.Logging": "1.0.0", 30 | "Microsoft.Extensions.Logging.Console": "1.0.0", 31 | "Microsoft.Extensions.Logging.Debug": "1.0.0", 32 | "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0", 33 | "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { 34 | "version": "1.0.0-preview2-final", 35 | "type": "build" 36 | }, 37 | "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { 38 | "version": "1.0.0-preview2-final", 39 | "type": "build" 40 | } 41 | }, 42 | 43 | "tools": { 44 | "BundlerMinifier.Core": "2.0.238", 45 | "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final", 46 | "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final", 47 | "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final", 48 | "Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final", 49 | "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { 50 | "version": "1.0.0-preview2-final", 51 | "imports": [ 52 | "portable-net45+win8" 53 | ] 54 | } 55 | }, 56 | 57 | "frameworks": { 58 | "netcoreapp1.0": { 59 | "imports": [ 60 | "dotnet5.6", 61 | "portable-net45+win8" 62 | ] 63 | } 64 | }, 65 | 66 | "buildOptions": { 67 | "emitEntryPoint": true, 68 | "preserveCompilationContext": true 69 | }, 70 | 71 | "runtimeOptions": { 72 | "configProperties": { 73 | "System.GC.Server": true 74 | } 75 | }, 76 | 77 | "publishOptions": { 78 | "include": [ 79 | "wwwroot", 80 | "Views", 81 | "Areas/**/Views", 82 | "appsettings.json", 83 | "web.config" 84 | ] 85 | }, 86 | 87 | "scripts": { 88 | "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ], 89 | "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] 90 | } 91 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "emitDecoratorMetadata": true, 4 | "experimentalDecorators": true, 5 | "module": "system", 6 | "moduleResolution": "node", 7 | "noImplicitAny": false, 8 | "noEmitOnError": true, 9 | "removeComments": false, 10 | "sourceMap": true, 11 | "target": "es5" 12 | }, 13 | "exclude": [ 14 | "node_modules", 15 | "wwwroot", 16 | "typings/main", 17 | "typings/main.d.ts" 18 | ] 19 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ASP.NET", 3 | "dependencies": {}, 4 | "devDependencies": {}, 5 | "ambientDependencies": { 6 | "es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/typings/browser.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/typings/main.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/Angular/app/app.component.js: -------------------------------------------------------------------------------- 1 | System.register(['@angular/core', '@angular/http', './contact-detail.component', './contact.service', 'rxjs/Rx'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 5 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 6 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 7 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 8 | return c > 3 && r && Object.defineProperty(target, key, r), r; 9 | }; 10 | var __metadata = (this && this.__metadata) || function (k, v) { 11 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 12 | }; 13 | var core_1, http_1, contact_detail_component_1, contact_service_1; 14 | var AppComponent; 15 | return { 16 | setters:[ 17 | function (core_1_1) { 18 | core_1 = core_1_1; 19 | }, 20 | function (http_1_1) { 21 | http_1 = http_1_1; 22 | }, 23 | function (contact_detail_component_1_1) { 24 | contact_detail_component_1 = contact_detail_component_1_1; 25 | }, 26 | function (contact_service_1_1) { 27 | contact_service_1 = contact_service_1_1; 28 | }, 29 | function (_1) {}], 30 | execute: function() { 31 | AppComponent = (function () { 32 | function AppComponent(_contactService) { 33 | this._contactService = _contactService; 34 | this.title = 'Contact List'; 35 | } 36 | AppComponent.prototype.getContacts = function () { 37 | var _this = this; 38 | this._contactService.getContacts() 39 | .subscribe(function (contacts) { 40 | console.log(contacts); 41 | _this.contacts = contacts; 42 | }, function (error) { return alert(error); }); 43 | }; 44 | AppComponent.prototype.ngOnInit = function () { 45 | this.getContacts(); 46 | }; 47 | AppComponent.prototype.onSelect = function (contact) { 48 | this.selectedContact = contact; 49 | }; 50 | AppComponent = __decorate([ 51 | core_1.Component({ 52 | selector: 'my-app', 53 | template: "\n

{{title}}

\n
    \n
  • \n {{contact.Id}} {{contact.Name}}\n
  • \n
\n \n ", 54 | directives: [contact_detail_component_1.ContactDetailComponent], 55 | providers: [ 56 | http_1.HTTP_PROVIDERS, 57 | contact_service_1.ContactService 58 | ] 59 | }), 60 | __metadata('design:paramtypes', [contact_service_1.ContactService]) 61 | ], AppComponent); 62 | return AppComponent; 63 | }()); 64 | exports_1("AppComponent", AppComponent); 65 | } 66 | } 67 | }); 68 | //# sourceMappingURL=app.component.js.map -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/Angular/app/boot.js: -------------------------------------------------------------------------------- 1 | System.register(['@angular/platform-browser-dynamic', './app.component'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var platform_browser_dynamic_1, app_component_1; 5 | return { 6 | setters:[ 7 | function (platform_browser_dynamic_1_1) { 8 | platform_browser_dynamic_1 = platform_browser_dynamic_1_1; 9 | }, 10 | function (app_component_1_1) { 11 | app_component_1 = app_component_1_1; 12 | }], 13 | execute: function() { 14 | platform_browser_dynamic_1.bootstrap(app_component_1.AppComponent); 15 | } 16 | } 17 | }); 18 | //# sourceMappingURL=boot.js.map -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/Angular/app/contact-detail.component.js: -------------------------------------------------------------------------------- 1 | System.register(['@angular/core'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 5 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 6 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 7 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 8 | return c > 3 && r && Object.defineProperty(target, key, r), r; 9 | }; 10 | var __metadata = (this && this.__metadata) || function (k, v) { 11 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 12 | }; 13 | var core_1; 14 | var ContactDetailComponent; 15 | return { 16 | setters:[ 17 | function (core_1_1) { 18 | core_1 = core_1_1; 19 | }], 20 | execute: function() { 21 | ContactDetailComponent = (function () { 22 | function ContactDetailComponent() { 23 | } 24 | ContactDetailComponent = __decorate([ 25 | core_1.Component({ 26 | selector: 'contact-detail', 27 | template: "\n
\n

{{contact.Name}}

\n
{{contact.Id}}
\n
\n \n
\n
\n
\n \n
\n
\n
\n \n
\n
\n
\n ", 28 | inputs: ['contact'] 29 | }), 30 | __metadata('design:paramtypes', []) 31 | ], ContactDetailComponent); 32 | return ContactDetailComponent; 33 | }()); 34 | exports_1("ContactDetailComponent", ContactDetailComponent); 35 | } 36 | } 37 | }); 38 | //# sourceMappingURL=contact-detail.component.js.map -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/Angular/app/contact.js: -------------------------------------------------------------------------------- 1 | System.register([], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | return { 5 | setters:[], 6 | execute: function() { 7 | } 8 | } 9 | }); 10 | //# sourceMappingURL=contact.js.map -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/Angular/app/contact.service.js: -------------------------------------------------------------------------------- 1 | System.register(['@angular/core', '@angular/http', 'rxjs/Observable'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 5 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 6 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 7 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 8 | return c > 3 && r && Object.defineProperty(target, key, r), r; 9 | }; 10 | var __metadata = (this && this.__metadata) || function (k, v) { 11 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 12 | }; 13 | var core_1, http_1, Observable_1; 14 | var ContactService; 15 | return { 16 | setters:[ 17 | function (core_1_1) { 18 | core_1 = core_1_1; 19 | }, 20 | function (http_1_1) { 21 | http_1 = http_1_1; 22 | }, 23 | function (Observable_1_1) { 24 | Observable_1 = Observable_1_1; 25 | }], 26 | execute: function() { 27 | ContactService = (function () { 28 | function ContactService(http) { 29 | this.http = http; 30 | this._url = 'http://localhost:6555/api/contacts/'; 31 | } 32 | ContactService.prototype.getContacts = function () { 33 | return this.http.get(this._url) 34 | .map(function (responce) { return responce.json(); }) 35 | .catch(function (error) { 36 | console.log(error); 37 | return Observable_1.Observable.throw(error); 38 | }); 39 | }; 40 | ContactService = __decorate([ 41 | core_1.Injectable(), 42 | __metadata('design:paramtypes', [http_1.Http]) 43 | ], ContactService); 44 | return ContactService; 45 | }()); 46 | exports_1("ContactService", ContactService); 47 | } 48 | } 49 | }); 50 | //# sourceMappingURL=contact.service.js.map -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/Angular/app/systemjs.config.js: -------------------------------------------------------------------------------- 1 | (function (global) { 2 | 3 | // map tells the System loader where to look for things 4 | var map = { 5 | 'app': '../Angular/app', 6 | 'rxjs': '../Angular/lib/rxjs', 7 | '@angular': '../Angular/lib/@angular' 8 | }; 9 | 10 | // packages tells the System loader how to load when no filename and/or no extension 11 | var packages = { 12 | 'app': { main: 'boot.js', defaultExtension: 'js' }, 13 | 'rxjs': { defaultExtension: 'js' } 14 | }; 15 | 16 | var packageNames = [ 17 | '@angular/common', 18 | '@angular/compiler', 19 | '@angular/core', 20 | '@angular/http', 21 | '@angular/platform-browser', 22 | '@angular/platform-browser-dynamic', 23 | '@angular/router', 24 | '@angular/router-deprecated', 25 | '@angular/testing', 26 | '@angular/upgrade' 27 | ]; 28 | 29 | // add package entries for angular packages in the form '@angular/common': { main: 'index.js', defaultExtension: 'js' } 30 | packageNames.forEach(function (pkgName) { 31 | packages[pkgName] = { main: 'index.js', defaultExtension: 'js' }; 32 | }); 33 | 34 | var config = { 35 | map: map, 36 | packages: packages 37 | } 38 | 39 | // filterSystemConfig - index.html's chance to modify config before we register it. 40 | if (global.filterSystemConfig) { global.filterSystemConfig(config); } 41 | 42 | System.config(config); 43 | 44 | })(this); -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/Aurelia/app.html: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/Aurelia/app.js: -------------------------------------------------------------------------------- 1 | import {inject} from 'aurelia-framework'; 2 | import {ContactService} from 'contactService'; 3 | 4 | export class ContactList { 5 | static inject = [ContactService]; 6 | heading = 'Contact List'; 7 | selectedContact = null; 8 | 9 | constructor (cs) { 10 | this.ContactService = cs; 11 | } 12 | 13 | created() { 14 | this.ContactService.GetAll() 15 | .then(contacts => this.contacts = contacts); 16 | } 17 | 18 | select(contact) { 19 | this.selectedContact = contact; 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/Aurelia/contact-detail.html: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/Aurelia/contact-detail.js: -------------------------------------------------------------------------------- 1 | import {bindable} from 'aurelia-framework'; 2 | 3 | export class ContactDetail { 4 | @bindable contact = null; 5 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/Aurelia/contactService.js: -------------------------------------------------------------------------------- 1 | import {inject} from 'aurelia-framework'; 2 | import {HttpClient, json} from 'aurelia-fetch-client'; 3 | import 'fetch'; 4 | 5 | export class ContactService { 6 | static inject = [HttpClient]; 7 | 8 | constructor(http) { 9 | http.configure(config => { 10 | config 11 | .useStandardConfiguration() 12 | .withBaseUrl('http://localhost:6555/api/contacts/'); 13 | }); 14 | 15 | this.http = http; 16 | } 17 | 18 | GetAll() { 19 | return this.http.fetch('') 20 | .then(response => response.json()) 21 | .then(contacts => this.contacts = contacts) 22 | .catch(error => console.log(error)); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/_references.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elanderson/ASP.NET-Core-SPAs/abc689f5674c4006359ff4341152714f466b01b5/src/ASP.NET-Core-SPAs/wwwroot/_references.js -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/config.js: -------------------------------------------------------------------------------- 1 | System.config({ 2 | baseURL: "../", 3 | defaultJSExtensions: true, 4 | transpiler: "babel", 5 | babelOptions: { 6 | "optional": [ 7 | "es7.decorators", 8 | "es7.classProperties" 9 | ] 10 | }, 11 | paths: { 12 | "*": "/Aurelia/*", 13 | "github:*": "jspm_packages/github/*", 14 | "npm:*": "jspm_packages/npm/*" 15 | }, 16 | 17 | map: { 18 | "aurelia-animator-css": "npm:aurelia-animator-css@1.0.0-rc.1.0.0", 19 | "aurelia-bootstrapper": "npm:aurelia-bootstrapper@1.0.0-rc.1.0.1", 20 | "aurelia-fetch-client": "npm:aurelia-fetch-client@1.0.0-rc.1.0.1", 21 | "aurelia-framework": "npm:aurelia-framework@1.0.0-rc.1.0.2", 22 | "aurelia-history-browser": "npm:aurelia-history-browser@1.0.0-rc.1.0.0", 23 | "aurelia-loader-default": "npm:aurelia-loader-default@1.0.0-rc.1.0.0", 24 | "aurelia-logging-console": "npm:aurelia-logging-console@1.0.0-rc.1.0.0", 25 | "aurelia-pal-browser": "npm:aurelia-pal-browser@1.0.0-rc.1.0.1", 26 | "aurelia-polyfills": "npm:aurelia-polyfills@1.0.0-rc.1.0.0", 27 | "aurelia-router": "npm:aurelia-router@1.0.0-rc.1.0.1", 28 | "aurelia-templating-binding": "npm:aurelia-templating-binding@1.0.0-rc.1.0.1", 29 | "aurelia-templating-resources": "npm:aurelia-templating-resources@1.0.0-rc.1.0.1", 30 | "aurelia-templating-router": "npm:aurelia-templating-router@1.0.0-rc.1.0.1", 31 | "babel": "npm:babel-core@5.8.38", 32 | "babel-runtime": "npm:babel-runtime@5.8.38", 33 | "bootstrap": "github:twbs/bootstrap@3.3.6", 34 | "core-js": "npm:core-js@2.4.1", 35 | "fetch": "github:github/fetch@1.0.0", 36 | "font-awesome": "npm:font-awesome@4.6.3", 37 | "text": "github:systemjs/plugin-text@0.0.8", 38 | "github:jspm/nodelibs-assert@0.1.0": { 39 | "assert": "npm:assert@1.4.1" 40 | }, 41 | "github:jspm/nodelibs-buffer@0.1.0": { 42 | "buffer": "npm:buffer@3.6.0" 43 | }, 44 | "github:jspm/nodelibs-path@0.1.0": { 45 | "path-browserify": "npm:path-browserify@0.0.0" 46 | }, 47 | "github:jspm/nodelibs-process@0.1.2": { 48 | "process": "npm:process@0.11.5" 49 | }, 50 | "github:jspm/nodelibs-util@0.1.0": { 51 | "util": "npm:util@0.10.3" 52 | }, 53 | "github:jspm/nodelibs-vm@0.1.0": { 54 | "vm-browserify": "npm:vm-browserify@0.0.4" 55 | }, 56 | "github:twbs/bootstrap@3.3.6": { 57 | "jquery": "npm:jquery@2.2.4" 58 | }, 59 | "npm:assert@1.4.1": { 60 | "assert": "github:jspm/nodelibs-assert@0.1.0", 61 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 62 | "process": "github:jspm/nodelibs-process@0.1.2", 63 | "util": "npm:util@0.10.3" 64 | }, 65 | "npm:aurelia-animator-css@1.0.0-rc.1.0.0": { 66 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-rc.1.0.1", 67 | "aurelia-pal": "npm:aurelia-pal@1.0.0-rc.1.0.0", 68 | "aurelia-templating": "npm:aurelia-templating@1.0.0-rc.1.0.1" 69 | }, 70 | "npm:aurelia-binding@1.0.0-rc.1.0.3": { 71 | "aurelia-logging": "npm:aurelia-logging@1.0.0-rc.1.0.1", 72 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-rc.1.0.1", 73 | "aurelia-pal": "npm:aurelia-pal@1.0.0-rc.1.0.0", 74 | "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-rc.1.0.0" 75 | }, 76 | "npm:aurelia-bootstrapper@1.0.0-rc.1.0.1": { 77 | "aurelia-event-aggregator": "npm:aurelia-event-aggregator@1.0.0-rc.1.0.0", 78 | "aurelia-framework": "npm:aurelia-framework@1.0.0-rc.1.0.2", 79 | "aurelia-history": "npm:aurelia-history@1.0.0-rc.1.0.0", 80 | "aurelia-history-browser": "npm:aurelia-history-browser@1.0.0-rc.1.0.0", 81 | "aurelia-loader-default": "npm:aurelia-loader-default@1.0.0-rc.1.0.0", 82 | "aurelia-logging-console": "npm:aurelia-logging-console@1.0.0-rc.1.0.0", 83 | "aurelia-pal": "npm:aurelia-pal@1.0.0-rc.1.0.0", 84 | "aurelia-pal-browser": "npm:aurelia-pal-browser@1.0.0-rc.1.0.1", 85 | "aurelia-polyfills": "npm:aurelia-polyfills@1.0.0-rc.1.0.0", 86 | "aurelia-router": "npm:aurelia-router@1.0.0-rc.1.0.1", 87 | "aurelia-templating": "npm:aurelia-templating@1.0.0-rc.1.0.1", 88 | "aurelia-templating-binding": "npm:aurelia-templating-binding@1.0.0-rc.1.0.1", 89 | "aurelia-templating-resources": "npm:aurelia-templating-resources@1.0.0-rc.1.0.1", 90 | "aurelia-templating-router": "npm:aurelia-templating-router@1.0.0-rc.1.0.1" 91 | }, 92 | "npm:aurelia-dependency-injection@1.0.0-rc.1.0.1": { 93 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-rc.1.0.1", 94 | "aurelia-pal": "npm:aurelia-pal@1.0.0-rc.1.0.0" 95 | }, 96 | "npm:aurelia-event-aggregator@1.0.0-rc.1.0.0": { 97 | "aurelia-logging": "npm:aurelia-logging@1.0.0-rc.1.0.1" 98 | }, 99 | "npm:aurelia-framework@1.0.0-rc.1.0.2": { 100 | "aurelia-binding": "npm:aurelia-binding@1.0.0-rc.1.0.3", 101 | "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-rc.1.0.1", 102 | "aurelia-loader": "npm:aurelia-loader@1.0.0-rc.1.0.0", 103 | "aurelia-logging": "npm:aurelia-logging@1.0.0-rc.1.0.1", 104 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-rc.1.0.1", 105 | "aurelia-pal": "npm:aurelia-pal@1.0.0-rc.1.0.0", 106 | "aurelia-path": "npm:aurelia-path@1.0.0-rc.1.0.0", 107 | "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-rc.1.0.0", 108 | "aurelia-templating": "npm:aurelia-templating@1.0.0-rc.1.0.1" 109 | }, 110 | "npm:aurelia-history-browser@1.0.0-rc.1.0.0": { 111 | "aurelia-history": "npm:aurelia-history@1.0.0-rc.1.0.0", 112 | "aurelia-pal": "npm:aurelia-pal@1.0.0-rc.1.0.0" 113 | }, 114 | "npm:aurelia-loader-default@1.0.0-rc.1.0.0": { 115 | "aurelia-loader": "npm:aurelia-loader@1.0.0-rc.1.0.0", 116 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-rc.1.0.1", 117 | "aurelia-pal": "npm:aurelia-pal@1.0.0-rc.1.0.0" 118 | }, 119 | "npm:aurelia-loader@1.0.0-rc.1.0.0": { 120 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-rc.1.0.1", 121 | "aurelia-path": "npm:aurelia-path@1.0.0-rc.1.0.0" 122 | }, 123 | "npm:aurelia-logging-console@1.0.0-rc.1.0.0": { 124 | "aurelia-logging": "npm:aurelia-logging@1.0.0-rc.1.0.1" 125 | }, 126 | "npm:aurelia-metadata@1.0.0-rc.1.0.1": { 127 | "aurelia-pal": "npm:aurelia-pal@1.0.0-rc.1.0.0" 128 | }, 129 | "npm:aurelia-pal-browser@1.0.0-rc.1.0.1": { 130 | "aurelia-pal": "npm:aurelia-pal@1.0.0-rc.1.0.0" 131 | }, 132 | "npm:aurelia-polyfills@1.0.0-rc.1.0.0": { 133 | "aurelia-pal": "npm:aurelia-pal@1.0.0-rc.1.0.0" 134 | }, 135 | "npm:aurelia-route-recognizer@1.0.0-rc.1.0.1": { 136 | "aurelia-path": "npm:aurelia-path@1.0.0-rc.1.0.0" 137 | }, 138 | "npm:aurelia-router@1.0.0-rc.1.0.1": { 139 | "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-rc.1.0.1", 140 | "aurelia-event-aggregator": "npm:aurelia-event-aggregator@1.0.0-rc.1.0.0", 141 | "aurelia-history": "npm:aurelia-history@1.0.0-rc.1.0.0", 142 | "aurelia-logging": "npm:aurelia-logging@1.0.0-rc.1.0.1", 143 | "aurelia-path": "npm:aurelia-path@1.0.0-rc.1.0.0", 144 | "aurelia-route-recognizer": "npm:aurelia-route-recognizer@1.0.0-rc.1.0.1" 145 | }, 146 | "npm:aurelia-task-queue@1.0.0-rc.1.0.0": { 147 | "aurelia-pal": "npm:aurelia-pal@1.0.0-rc.1.0.0" 148 | }, 149 | "npm:aurelia-templating-binding@1.0.0-rc.1.0.1": { 150 | "aurelia-binding": "npm:aurelia-binding@1.0.0-rc.1.0.3", 151 | "aurelia-logging": "npm:aurelia-logging@1.0.0-rc.1.0.1", 152 | "aurelia-templating": "npm:aurelia-templating@1.0.0-rc.1.0.1" 153 | }, 154 | "npm:aurelia-templating-resources@1.0.0-rc.1.0.1": { 155 | "aurelia-binding": "npm:aurelia-binding@1.0.0-rc.1.0.3", 156 | "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-rc.1.0.1", 157 | "aurelia-loader": "npm:aurelia-loader@1.0.0-rc.1.0.0", 158 | "aurelia-logging": "npm:aurelia-logging@1.0.0-rc.1.0.1", 159 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-rc.1.0.1", 160 | "aurelia-pal": "npm:aurelia-pal@1.0.0-rc.1.0.0", 161 | "aurelia-path": "npm:aurelia-path@1.0.0-rc.1.0.0", 162 | "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-rc.1.0.0", 163 | "aurelia-templating": "npm:aurelia-templating@1.0.0-rc.1.0.1" 164 | }, 165 | "npm:aurelia-templating-router@1.0.0-rc.1.0.1": { 166 | "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-rc.1.0.1", 167 | "aurelia-logging": "npm:aurelia-logging@1.0.0-rc.1.0.1", 168 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-rc.1.0.1", 169 | "aurelia-pal": "npm:aurelia-pal@1.0.0-rc.1.0.0", 170 | "aurelia-path": "npm:aurelia-path@1.0.0-rc.1.0.0", 171 | "aurelia-router": "npm:aurelia-router@1.0.0-rc.1.0.1", 172 | "aurelia-templating": "npm:aurelia-templating@1.0.0-rc.1.0.1" 173 | }, 174 | "npm:aurelia-templating@1.0.0-rc.1.0.1": { 175 | "aurelia-binding": "npm:aurelia-binding@1.0.0-rc.1.0.3", 176 | "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-rc.1.0.1", 177 | "aurelia-loader": "npm:aurelia-loader@1.0.0-rc.1.0.0", 178 | "aurelia-logging": "npm:aurelia-logging@1.0.0-rc.1.0.1", 179 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-rc.1.0.1", 180 | "aurelia-pal": "npm:aurelia-pal@1.0.0-rc.1.0.0", 181 | "aurelia-path": "npm:aurelia-path@1.0.0-rc.1.0.0", 182 | "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-rc.1.0.0" 183 | }, 184 | "npm:babel-runtime@5.8.38": { 185 | "process": "github:jspm/nodelibs-process@0.1.2" 186 | }, 187 | "npm:buffer@3.6.0": { 188 | "base64-js": "npm:base64-js@0.0.8", 189 | "child_process": "github:jspm/nodelibs-child_process@0.1.0", 190 | "fs": "github:jspm/nodelibs-fs@0.1.2", 191 | "ieee754": "npm:ieee754@1.1.6", 192 | "isarray": "npm:isarray@1.0.0", 193 | "process": "github:jspm/nodelibs-process@0.1.2" 194 | }, 195 | "npm:core-js@2.4.1": { 196 | "fs": "github:jspm/nodelibs-fs@0.1.2", 197 | "path": "github:jspm/nodelibs-path@0.1.0", 198 | "process": "github:jspm/nodelibs-process@0.1.2", 199 | "systemjs-json": "github:systemjs/plugin-json@0.1.2" 200 | }, 201 | "npm:font-awesome@4.6.3": { 202 | "css": "github:systemjs/plugin-css@0.1.23" 203 | }, 204 | "npm:inherits@2.0.1": { 205 | "util": "github:jspm/nodelibs-util@0.1.0" 206 | }, 207 | "npm:path-browserify@0.0.0": { 208 | "process": "github:jspm/nodelibs-process@0.1.2" 209 | }, 210 | "npm:process@0.11.5": { 211 | "assert": "github:jspm/nodelibs-assert@0.1.0", 212 | "fs": "github:jspm/nodelibs-fs@0.1.2", 213 | "vm": "github:jspm/nodelibs-vm@0.1.0" 214 | }, 215 | "npm:util@0.10.3": { 216 | "inherits": "npm:inherits@2.0.1", 217 | "process": "github:jspm/nodelibs-process@0.1.2" 218 | }, 219 | "npm:vm-browserify@0.0.4": { 220 | "indexof": "npm:indexof@0.0.1" 221 | } 222 | } 223 | }); 224 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Wrapping element */ 7 | /* Set some basic padding to keep content from hitting the edges */ 8 | .body-content { 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | } 12 | 13 | /* Set widths on the form inputs since otherwise they're 100% wide */ 14 | input, 15 | select, 16 | textarea { 17 | max-width: 280px; 18 | } 19 | 20 | /* Carousel */ 21 | .carousel-caption { 22 | z-index: 10 !important; 23 | } 24 | 25 | .carousel-caption p { 26 | font-size: 20px; 27 | line-height: 1.4; 28 | } 29 | 30 | @media (min-width: 768px) { 31 | .carousel-caption { 32 | z-index: 10 !important; 33 | } 34 | } 35 | 36 | .selected { 37 | background-color: #CFD8DC !important; 38 | color: white; 39 | } 40 | .contacts { 41 | margin: 0 0 2em 0; 42 | list-style-type: none; 43 | padding: 0; 44 | width: 10em; 45 | } 46 | .contacts li { 47 | cursor: pointer; 48 | position: relative; 49 | left: 0; 50 | background-color: #EEE; 51 | margin: .5em; 52 | padding: .3em 0em; 53 | height: 1.6em; 54 | border-radius: 4px; 55 | } 56 | .contacts li.selected:hover { 57 | color: white; 58 | } 59 | .contacts li:hover { 60 | color: #607D8B; 61 | background-color: #EEE; 62 | left: .1em; 63 | } 64 | .contacts .text { 65 | position: relative; 66 | top: -3px; 67 | } 68 | .contacts .badge { 69 | display: inline-block; 70 | font-size: small; 71 | color: white; 72 | padding: 0.8em 0.7em 0em 0.7em; 73 | background-color: #607D8B; 74 | line-height: 1em; 75 | position: relative; 76 | left: -1px; 77 | top: -4px; 78 | height: 1.8em; 79 | margin-right: .8em; 80 | border-radius: 4px 0px 0px 4px; 81 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elanderson/ASP.NET-Core-SPAs/abc689f5674c4006359ff4341152714f466b01b5/src/ASP.NET-Core-SPAs/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/images/ASP-NET-Banners-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elanderson/ASP.NET-Core-SPAs/abc689f5674c4006359ff4341152714f466b01b5/src/ASP.NET-Core-SPAs/wwwroot/images/ASP-NET-Banners-01.png -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/images/ASP-NET-Banners-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elanderson/ASP.NET-Core-SPAs/abc689f5674c4006359ff4341152714f466b01b5/src/ASP.NET-Core-SPAs/wwwroot/images/ASP-NET-Banners-02.png -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/images/Banner-01-Azure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elanderson/ASP.NET-Core-SPAs/abc689f5674c4006359ff4341152714f466b01b5/src/ASP.NET-Core-SPAs/wwwroot/images/Banner-01-Azure.png -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/images/Banner-02-VS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elanderson/ASP.NET-Core-SPAs/abc689f5674c4006359ff4341152714f466b01b5/src/ASP.NET-Core-SPAs/wwwroot/images/Banner-02-VS.png -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your Javascript code. 2 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": ">= 1.9.1" 33 | }, 34 | "version": "3.3.5", 35 | "_release": "3.3.5", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.5", 39 | "commit": "16b48259a62f576e52c903c476bd42b90ab22482" 40 | }, 41 | "_source": "git://github.com/twbs/bootstrap.git", 42 | "_target": "3.3.5", 43 | "_originalSource": "bootstrap" 44 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2015 Twitter, Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elanderson/ASP.NET-Core-SPAs/abc689f5674c4006359ff4341152714f466b01b5/src/ASP.NET-Core-SPAs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elanderson/ASP.NET-Core-SPAs/abc689f5674c4006359ff4341152714f466b01b5/src/ASP.NET-Core-SPAs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elanderson/ASP.NET-Core-SPAs/abc689f5674c4006359ff4341152714f466b01b5/src/ASP.NET-Core-SPAs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elanderson/ASP.NET-Core-SPAs/abc689f5674c4006359ff4341152714f466b01b5/src/ASP.NET-Core-SPAs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "version": "3.2.4", 4 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 5 | "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", 6 | "main": [ 7 | "jquery.validate.unobtrusive.js" 8 | ], 9 | "ignore": [ 10 | "**/.*", 11 | "*.json", 12 | "*.md", 13 | "*.txt", 14 | "gulpfile.js" 15 | ], 16 | "keywords": [ 17 | "jquery", 18 | "asp.net", 19 | "mvc", 20 | "validation", 21 | "unobtrusive" 22 | ], 23 | "authors": [ 24 | "Microsoft" 25 | ], 26 | "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", 27 | "repository": { 28 | "type": "git", 29 | "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" 30 | }, 31 | "dependencies": { 32 | "jquery-validation": ">=1.8", 33 | "jquery": ">=1.8" 34 | }, 35 | "_release": "3.2.4", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.2.4", 39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7" 40 | }, 41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git", 42 | "_target": "3.2.4", 43 | "_originalSource": "jquery-validation-unobtrusive" 44 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** Unobtrusive validation support library for jQuery and jQuery Validate 3 | ** Copyright (C) Microsoft Corporation. All rights reserved. 4 | */ 5 | !function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a("
  • ").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function m(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=p.unobtrusive.options||{},m=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),m("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),m("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),m("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var u,p=a.validator,v="unobtrusiveValidation";p.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=m(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){p.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=m(this);a&&a.attachValidation()})}},u=p.unobtrusive.adapters,u.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},u.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},u.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},u.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},p.addMethod("__dummy__",function(a,e,n){return!0}),p.addMethod("regex",function(a,e,n){var t;return this.optional(e)?!0:(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),p.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),p.methods.extension?(u.addSingleVal("accept","mimtype"),u.addSingleVal("extension","extension")):u.addSingleVal("extension","extension","accept"),u.addSingleVal("regex","pattern"),u.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),u.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),u.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),u.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),u.add("required",function(a){("INPUT"!==a.element.tagName.toUpperCase()||"CHECKBOX"!==a.element.type.toUpperCase())&&e(a,"required",!0)}),u.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),u.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),a(function(){p.unobtrusive.parse(document)})}(jQuery); -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.14.0", 31 | "_release": "1.14.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.14.0", 35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" 36 | }, 37 | "_source": "git://github.com/jzaefferer/jquery-validation.git", 38 | "_target": ">=1.8", 39 | "_originalSource": "jquery-validation" 40 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "version": "2.1.4", 4 | "main": "dist/jquery.js", 5 | "license": "MIT", 6 | "ignore": [ 7 | "**/.*", 8 | "build", 9 | "dist/cdn", 10 | "speed", 11 | "test", 12 | "*.md", 13 | "AUTHORS.txt", 14 | "Gruntfile.js", 15 | "package.json" 16 | ], 17 | "devDependencies": { 18 | "sizzle": "2.1.1-jquery.2.1.2", 19 | "requirejs": "2.1.10", 20 | "qunit": "1.14.0", 21 | "sinon": "1.8.1" 22 | }, 23 | "keywords": [ 24 | "jquery", 25 | "javascript", 26 | "library" 27 | ], 28 | "homepage": "https://github.com/jquery/jquery", 29 | "_release": "2.1.4", 30 | "_resolution": { 31 | "type": "version", 32 | "tag": "2.1.4", 33 | "commit": "7751e69b615c6eca6f783a81e292a55725af6b85" 34 | }, 35 | "_source": "git://github.com/jquery/jquery.git", 36 | "_target": "2.1.4", 37 | "_originalSource": "jquery" 38 | } -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/lib/jquery/MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2014 jQuery Foundation and other contributors 2 | http://jquery.com/ 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/ASP.NET-Core-SPAs/wwwroot/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | --------------------------------------------------------------------------------