├── .gitattributes ├── .gitignore ├── .vs ├── BlogPlayground │ └── v14 │ │ └── .suo ├── config │ └── applicationhost.config └── restore.dg ├── BlogPlayground.sln ├── global.json └── src └── BlogPlayground ├── .bowerrc ├── BlogPlayground.xproj ├── BlogPlayground.xproj.user ├── Controllers ├── AccountController.cs ├── ArticlesController.cs ├── HomeController.cs └── ManageController.cs ├── Data ├── ApplicationDbContext.cs └── Migrations │ ├── 00000000000000_CreateIdentitySchema.Designer.cs │ ├── 00000000000000_CreateIdentitySchema.cs │ ├── 20160910210414_update-profile.Designer.cs │ ├── 20160910210414_update-profile.cs │ ├── 20160913175647_articles.Designer.cs │ ├── 20160913175647_articles.cs │ └── ApplicationDbContextModelSnapshot.cs ├── Models ├── AccountViewModels │ ├── ExternalLoginConfirmationViewModel.cs │ ├── ForgotPasswordViewModel.cs │ ├── LoginViewModel.cs │ ├── RegisterViewModel.cs │ ├── ResetPasswordViewModel.cs │ ├── SendCodeViewModel.cs │ └── VerifyCodeViewModel.cs ├── ApplicationUser.cs ├── Article.cs └── ManageViewModels │ ├── AddPhoneNumberViewModel.cs │ ├── ChangePasswordViewModel.cs │ ├── ConfigureTwoFactorViewModel.cs │ ├── FactorViewModel.cs │ ├── IndexViewModel.cs │ ├── ManageLoginsViewModel.cs │ ├── RemoveLoginViewModel.cs │ ├── SetPasswordViewModel.cs │ └── VerifyPhoneNumberViewModel.cs ├── Program.cs ├── Project_Readme.html ├── Properties └── launchSettings.json ├── Services ├── GooglePictureLocator.cs ├── IEmailSender.cs ├── IGooglePictureLocator.cs ├── ISmsSender.cs └── MessageServices.cs ├── Startup.cs ├── TagHelpers ├── MarkdownTagHelper.cs └── ProfilePictureTagHelper.cs ├── ViewComponents └── LatestArticlesViewComponent.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 ├── Articles │ ├── Create.cshtml │ ├── Delete.cshtml │ ├── Details.cshtml │ ├── Index.cshtml │ └── _ArticleSummary.cshtml ├── Home │ ├── About.cshtml │ ├── Contact.cshtml │ └── Index.cshtml ├── Manage │ ├── AddPhoneNumber.cshtml │ ├── ChangePassword.cshtml │ ├── Index.cshtml │ ├── ManageLogins.cshtml │ ├── SetPassword.cshtml │ └── VerifyPhoneNumber.cshtml ├── Shared │ ├── Components │ │ └── LatestArticles │ │ │ └── Default.cshtml │ ├── Error.cshtml │ ├── _Layout.cshtml │ ├── _LoginPartial.cshtml │ └── _ValidationScriptsPartial.cshtml ├── _ViewImports.cshtml └── _ViewStart.cshtml ├── appsettings.json ├── bin └── Debug │ └── netcoreapp1.0 │ ├── BlogPlayground.deps.json │ ├── BlogPlayground.dll │ ├── BlogPlayground.pdb │ ├── BlogPlayground.runtimeconfig.dev.json │ ├── BlogPlayground.runtimeconfig.json │ └── d0958e9c-2f96-42be-8c32-48c320f1d5bc_BlogPlayground.dll ├── bower.json ├── bundleconfig.json ├── obj └── Debug │ └── netcoreapp1.0 │ ├── .IncrementalCache │ ├── .SDKVersion │ ├── BlogPlaygrounddotnet-compile.deps.json │ ├── dotnet-compile-csc.rsp │ ├── dotnet-compile.assemblyinfo.cs │ └── dotnet-compile.rsp ├── project.json ├── project.lock.json ├── web.config └── wwwroot ├── _references.js ├── css ├── site.css └── site.min.css ├── favicon.ico ├── images ├── banner1.svg ├── banner2.svg ├── banner3.svg ├── banner4.svg └── placeholder.png ├── js ├── site.js └── site.min.js └── lib ├── bootstrap ├── .bower.json ├── LICENSE └── dist │ ├── css │ ├── bootstrap-theme.css │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css │ ├── bootstrap-theme.min.css.map │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ └── bootstrap.min.css.map │ ├── 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 ├── LICENSE.txt └── dist ├── jquery.js ├── jquery.min.js └── jquery.min.map /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | 42 | # Directories potentially created on remote AFP share 43 | .AppleDB 44 | .AppleDesktop 45 | Network Trash Folder 46 | Temporary Items 47 | .apdisk 48 | -------------------------------------------------------------------------------- /.vs/BlogPlayground/v14/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/asp.net-core-blogging-site/c8b0e0a98e06614d66e4f926d1b8aa5051ab489e/.vs/BlogPlayground/v14/.suo -------------------------------------------------------------------------------- /.vs/restore.dg: -------------------------------------------------------------------------------- 1 | #:C:\Users\Daniel.Garcia\Documents\Github\BlogPlayground\src\BlogPlayground\BlogPlayground.xproj 2 | -------------------------------------------------------------------------------- /BlogPlayground.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7CFDF67D-EAA6-4E28-820E-1B7A39886180}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4BC2A7FA-1DF5-4B8D-8A90-54EC4BE82E8E}" 9 | ProjectSection(SolutionItems) = preProject 10 | global.json = global.json 11 | EndProjectSection 12 | EndProject 13 | Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "BlogPlayground", "src\BlogPlayground\BlogPlayground.xproj", "{0723636E-4E08-41FA-AF4A-5A0FF9EFD926}" 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 | {0723636E-4E08-41FA-AF4A-5A0FF9EFD926}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 22 | {0723636E-4E08-41FA-AF4A-5A0FF9EFD926}.Debug|Any CPU.Build.0 = Debug|Any CPU 23 | {0723636E-4E08-41FA-AF4A-5A0FF9EFD926}.Release|Any CPU.ActiveCfg = Release|Any CPU 24 | {0723636E-4E08-41FA-AF4A-5A0FF9EFD926}.Release|Any CPU.Build.0 = Release|Any CPU 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | GlobalSection(NestedProjects) = preSolution 30 | {0723636E-4E08-41FA-AF4A-5A0FF9EFD926} = {7CFDF67D-EAA6-4E28-820E-1B7A39886180} 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": [ "src", "test" ], 3 | "sdk": { 4 | "version": "1.0.0-preview2-003121" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/BlogPlayground/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "wwwroot/lib" 3 | } 4 | -------------------------------------------------------------------------------- /src/BlogPlayground/BlogPlayground.xproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 14.0 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | 7 | 8 | 9 | 0723636e-4e08-41fa-af4a-5a0ff9efd926 10 | BlogPlayground 11 | .\obj 12 | .\bin\ 13 | v4.5.2 14 | 15 | 16 | 2.0 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/BlogPlayground/BlogPlayground.xproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | IIS Express 5 | false 6 | 600 7 | 600 8 | True 9 | True 10 | False 11 | 12 | BlogPlayground.Data.ApplicationDbContext 13 | False 14 | True 15 | 600 16 | 17 | -------------------------------------------------------------------------------- /src/BlogPlayground/Controllers/ArticlesController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.Rendering; 7 | using Microsoft.EntityFrameworkCore; 8 | using BlogPlayground.Data; 9 | using BlogPlayground.Models; 10 | using Microsoft.AspNetCore.Identity; 11 | using Microsoft.AspNetCore.Authorization; 12 | 13 | namespace BlogPlayground.Controllers 14 | { 15 | public class ArticlesController : Controller 16 | { 17 | private readonly ApplicationDbContext _context; 18 | private readonly UserManager _userManager; 19 | 20 | public ArticlesController(ApplicationDbContext context, UserManager userManager) 21 | { 22 | _context = context; 23 | _userManager = userManager; 24 | } 25 | 26 | // GET: Articles 27 | public async Task Index() 28 | { 29 | var applicationDbContext = _context.Article.Include(a => a.Author); 30 | return View(await applicationDbContext.ToListAsync()); 31 | } 32 | 33 | // GET: Articles/Details/5 34 | public async Task Details(int? id) 35 | { 36 | if (id == null) 37 | { 38 | return NotFound(); 39 | } 40 | 41 | var article = await _context.Article 42 | .Include(a => a.Author) 43 | .SingleOrDefaultAsync(m => m.ArticleId == id); 44 | if (article == null) 45 | { 46 | return NotFound(); 47 | } 48 | 49 | return View(article); 50 | } 51 | 52 | // GET: Articles/Create 53 | [Authorize] 54 | public IActionResult Create() 55 | { 56 | return View(); 57 | } 58 | 59 | // POST: Articles/Create 60 | // To protect from overposting attacks, please enable the specific properties you want to bind to, for 61 | // more details see http://go.microsoft.com/fwlink/?LinkId=317598. 62 | [HttpPost] 63 | [ValidateAntiForgeryToken] 64 | [Authorize] 65 | public async Task Create([Bind("Title, Abstract,Contents")] Article article) 66 | { 67 | if (ModelState.IsValid) 68 | { 69 | article.AuthorId = _userManager.GetUserId(this.User); 70 | article.CreatedDate = DateTime.Now; 71 | _context.Add(article); 72 | await _context.SaveChangesAsync(); 73 | return RedirectToAction("Index"); 74 | } 75 | return View(article); 76 | } 77 | 78 | // GET: Articles/Delete/5 79 | [Authorize] 80 | public async Task Delete(int? id) 81 | { 82 | if (id == null) 83 | { 84 | return NotFound(); 85 | } 86 | 87 | var article = await _context.Article.SingleOrDefaultAsync(m => m.ArticleId == id); 88 | if (article == null) 89 | { 90 | return NotFound(); 91 | } 92 | 93 | return View(article); 94 | } 95 | 96 | // POST: Articles/Delete/5 97 | [HttpPost, ActionName("Delete")] 98 | [ValidateAntiForgeryToken] 99 | [Authorize] 100 | public async Task DeleteConfirmed(int id) 101 | { 102 | var article = await _context.Article.SingleOrDefaultAsync(m => m.ArticleId == id); 103 | _context.Article.Remove(article); 104 | await _context.SaveChangesAsync(); 105 | return RedirectToAction("Index"); 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /src/BlogPlayground/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | namespace BlogPlayground.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public IActionResult Index() 12 | { 13 | return View(); 14 | } 15 | 16 | public IActionResult About() 17 | { 18 | ViewData["Message"] = "Your application description page."; 19 | 20 | return View(); 21 | } 22 | 23 | public IActionResult Contact() 24 | { 25 | ViewData["Message"] = "Your contact page."; 26 | 27 | return View(); 28 | } 29 | 30 | public IActionResult Error() 31 | { 32 | return View(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/BlogPlayground/Data/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 6 | using Microsoft.EntityFrameworkCore; 7 | using BlogPlayground.Models; 8 | 9 | namespace BlogPlayground.Data 10 | { 11 | public class ApplicationDbContext : IdentityDbContext 12 | { 13 | public ApplicationDbContext(DbContextOptions options) 14 | : base(options) 15 | { 16 | } 17 | 18 | protected override void OnModelCreating(ModelBuilder builder) 19 | { 20 | base.OnModelCreating(builder); 21 | // Customize the ASP.NET Identity model and override the defaults if needed. 22 | // For example, you can rename the ASP.NET Identity table names and more. 23 | // Add your customizations after calling base.OnModelCreating(builder); 24 | } 25 | 26 | public DbSet
Article { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/BlogPlayground/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.EntityFrameworkCore; 6 | using Microsoft.EntityFrameworkCore.Infrastructure; 7 | using Microsoft.EntityFrameworkCore.Metadata; 8 | using Microsoft.EntityFrameworkCore.Migrations; 9 | 10 | namespace BlogPlayground.Data.Migrations 11 | { 12 | [DbContext(typeof(ApplicationDbContext))] 13 | [Migration("00000000000000_CreateIdentitySchema")] 14 | partial class CreateIdentitySchema 15 | { 16 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 17 | { 18 | modelBuilder 19 | .HasAnnotation("ProductVersion", "1.0.0-rc3") 20 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 21 | 22 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => 23 | { 24 | b.Property("Id"); 25 | 26 | b.Property("ConcurrencyStamp") 27 | .IsConcurrencyToken(); 28 | 29 | b.Property("Name") 30 | .HasAnnotation("MaxLength", 256); 31 | 32 | b.Property("NormalizedName") 33 | .HasAnnotation("MaxLength", 256); 34 | 35 | b.HasKey("Id"); 36 | 37 | b.HasIndex("NormalizedName") 38 | .HasName("RoleNameIndex"); 39 | 40 | b.ToTable("AspNetRoles"); 41 | }); 42 | 43 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => 44 | { 45 | b.Property("Id") 46 | .ValueGeneratedOnAdd(); 47 | 48 | b.Property("ClaimType"); 49 | 50 | b.Property("ClaimValue"); 51 | 52 | b.Property("RoleId") 53 | .IsRequired(); 54 | 55 | b.HasKey("Id"); 56 | 57 | b.HasIndex("RoleId"); 58 | 59 | b.ToTable("AspNetRoleClaims"); 60 | }); 61 | 62 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => 63 | { 64 | b.Property("Id") 65 | .ValueGeneratedOnAdd(); 66 | 67 | b.Property("ClaimType"); 68 | 69 | b.Property("ClaimValue"); 70 | 71 | b.Property("UserId") 72 | .IsRequired(); 73 | 74 | b.HasKey("Id"); 75 | 76 | b.HasIndex("UserId"); 77 | 78 | b.ToTable("AspNetUserClaims"); 79 | }); 80 | 81 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => 82 | { 83 | b.Property("LoginProvider"); 84 | 85 | b.Property("ProviderKey"); 86 | 87 | b.Property("ProviderDisplayName"); 88 | 89 | b.Property("UserId") 90 | .IsRequired(); 91 | 92 | b.HasKey("LoginProvider", "ProviderKey"); 93 | 94 | b.HasIndex("UserId"); 95 | 96 | b.ToTable("AspNetUserLogins"); 97 | }); 98 | 99 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => 100 | { 101 | b.Property("UserId"); 102 | 103 | b.Property("RoleId"); 104 | 105 | b.HasKey("UserId", "RoleId"); 106 | 107 | b.HasIndex("RoleId"); 108 | 109 | b.HasIndex("UserId"); 110 | 111 | b.ToTable("AspNetUserRoles"); 112 | }); 113 | 114 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken", b => 115 | { 116 | b.Property("UserId"); 117 | 118 | b.Property("LoginProvider"); 119 | 120 | b.Property("Name"); 121 | 122 | b.Property("Value"); 123 | 124 | b.HasKey("UserId", "LoginProvider", "Name"); 125 | 126 | b.ToTable("AspNetUserTokens"); 127 | }); 128 | 129 | modelBuilder.Entity("BlogPlayground.Models.ApplicationUser", b => 130 | { 131 | b.Property("Id"); 132 | 133 | b.Property("AccessFailedCount"); 134 | 135 | b.Property("ConcurrencyStamp") 136 | .IsConcurrencyToken(); 137 | 138 | b.Property("Email") 139 | .HasAnnotation("MaxLength", 256); 140 | 141 | b.Property("EmailConfirmed"); 142 | 143 | b.Property("LockoutEnabled"); 144 | 145 | b.Property("LockoutEnd"); 146 | 147 | b.Property("NormalizedEmail") 148 | .HasAnnotation("MaxLength", 256); 149 | 150 | b.Property("NormalizedUserName") 151 | .HasAnnotation("MaxLength", 256); 152 | 153 | b.Property("PasswordHash"); 154 | 155 | b.Property("PhoneNumber"); 156 | 157 | b.Property("PhoneNumberConfirmed"); 158 | 159 | b.Property("SecurityStamp"); 160 | 161 | b.Property("TwoFactorEnabled"); 162 | 163 | b.Property("UserName") 164 | .HasAnnotation("MaxLength", 256); 165 | 166 | b.HasKey("Id"); 167 | 168 | b.HasIndex("NormalizedEmail") 169 | .HasName("EmailIndex"); 170 | 171 | b.HasIndex("NormalizedUserName") 172 | .IsUnique() 173 | .HasName("UserNameIndex"); 174 | 175 | b.ToTable("AspNetUsers"); 176 | }); 177 | 178 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => 179 | { 180 | b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") 181 | .WithMany("Claims") 182 | .HasForeignKey("RoleId") 183 | .OnDelete(DeleteBehavior.Cascade); 184 | }); 185 | 186 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => 187 | { 188 | b.HasOne("BlogPlayground.Models.ApplicationUser") 189 | .WithMany("Claims") 190 | .HasForeignKey("UserId") 191 | .OnDelete(DeleteBehavior.Cascade); 192 | }); 193 | 194 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => 195 | { 196 | b.HasOne("BlogPlayground.Models.ApplicationUser") 197 | .WithMany("Logins") 198 | .HasForeignKey("UserId") 199 | .OnDelete(DeleteBehavior.Cascade); 200 | }); 201 | 202 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => 203 | { 204 | b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") 205 | .WithMany("Users") 206 | .HasForeignKey("RoleId") 207 | .OnDelete(DeleteBehavior.Cascade); 208 | 209 | b.HasOne("BlogPlayground.Models.ApplicationUser") 210 | .WithMany("Roles") 211 | .HasForeignKey("UserId") 212 | .OnDelete(DeleteBehavior.Cascade); 213 | }); 214 | } 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /src/BlogPlayground/Data/Migrations/00000000000000_CreateIdentitySchema.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.EntityFrameworkCore.Metadata; 6 | using Microsoft.EntityFrameworkCore.Migrations; 7 | 8 | namespace BlogPlayground.Data.Migrations 9 | { 10 | public partial class CreateIdentitySchema : Migration 11 | { 12 | protected override void Up(MigrationBuilder migrationBuilder) 13 | { 14 | migrationBuilder.CreateTable( 15 | name: "AspNetRoles", 16 | columns: table => new 17 | { 18 | Id = table.Column(nullable: false), 19 | ConcurrencyStamp = table.Column(nullable: true), 20 | Name = table.Column(maxLength: 256, nullable: true), 21 | NormalizedName = table.Column(maxLength: 256, nullable: true) 22 | }, 23 | constraints: table => 24 | { 25 | table.PrimaryKey("PK_AspNetRoles", x => x.Id); 26 | }); 27 | 28 | migrationBuilder.CreateTable( 29 | name: "AspNetUserTokens", 30 | columns: table => new 31 | { 32 | UserId = table.Column(nullable: false), 33 | LoginProvider = table.Column(nullable: false), 34 | Name = table.Column(nullable: false), 35 | Value = table.Column(nullable: true) 36 | }, 37 | constraints: table => 38 | { 39 | table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); 40 | }); 41 | 42 | migrationBuilder.CreateTable( 43 | name: "AspNetUsers", 44 | columns: table => new 45 | { 46 | Id = table.Column(nullable: false), 47 | AccessFailedCount = table.Column(nullable: false), 48 | ConcurrencyStamp = table.Column(nullable: true), 49 | Email = table.Column(maxLength: 256, nullable: true), 50 | EmailConfirmed = table.Column(nullable: false), 51 | LockoutEnabled = table.Column(nullable: false), 52 | LockoutEnd = table.Column(nullable: true), 53 | NormalizedEmail = table.Column(maxLength: 256, nullable: true), 54 | NormalizedUserName = table.Column(maxLength: 256, nullable: true), 55 | PasswordHash = table.Column(nullable: true), 56 | PhoneNumber = table.Column(nullable: true), 57 | PhoneNumberConfirmed = table.Column(nullable: false), 58 | SecurityStamp = table.Column(nullable: true), 59 | TwoFactorEnabled = table.Column(nullable: false), 60 | UserName = table.Column(maxLength: 256, nullable: true) 61 | }, 62 | constraints: table => 63 | { 64 | table.PrimaryKey("PK_AspNetUsers", x => x.Id); 65 | }); 66 | 67 | migrationBuilder.CreateTable( 68 | name: "AspNetRoleClaims", 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 | RoleId = table.Column(nullable: false) 76 | }, 77 | constraints: table => 78 | { 79 | table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); 80 | table.ForeignKey( 81 | name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", 82 | column: x => x.RoleId, 83 | principalTable: "AspNetRoles", 84 | principalColumn: "Id", 85 | onDelete: ReferentialAction.Cascade); 86 | }); 87 | 88 | migrationBuilder.CreateTable( 89 | name: "AspNetUserClaims", 90 | columns: table => new 91 | { 92 | Id = table.Column(nullable: false) 93 | .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), 94 | ClaimType = table.Column(nullable: true), 95 | ClaimValue = table.Column(nullable: true), 96 | UserId = table.Column(nullable: false) 97 | }, 98 | constraints: table => 99 | { 100 | table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); 101 | table.ForeignKey( 102 | name: "FK_AspNetUserClaims_AspNetUsers_UserId", 103 | column: x => x.UserId, 104 | principalTable: "AspNetUsers", 105 | principalColumn: "Id", 106 | onDelete: ReferentialAction.Cascade); 107 | }); 108 | 109 | migrationBuilder.CreateTable( 110 | name: "AspNetUserLogins", 111 | columns: table => new 112 | { 113 | LoginProvider = table.Column(nullable: false), 114 | ProviderKey = table.Column(nullable: false), 115 | ProviderDisplayName = table.Column(nullable: true), 116 | UserId = table.Column(nullable: false) 117 | }, 118 | constraints: table => 119 | { 120 | table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); 121 | table.ForeignKey( 122 | name: "FK_AspNetUserLogins_AspNetUsers_UserId", 123 | column: x => x.UserId, 124 | principalTable: "AspNetUsers", 125 | principalColumn: "Id", 126 | onDelete: ReferentialAction.Cascade); 127 | }); 128 | 129 | migrationBuilder.CreateTable( 130 | name: "AspNetUserRoles", 131 | columns: table => new 132 | { 133 | UserId = table.Column(nullable: false), 134 | RoleId = table.Column(nullable: false) 135 | }, 136 | constraints: table => 137 | { 138 | table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); 139 | table.ForeignKey( 140 | name: "FK_AspNetUserRoles_AspNetRoles_RoleId", 141 | column: x => x.RoleId, 142 | principalTable: "AspNetRoles", 143 | principalColumn: "Id", 144 | onDelete: ReferentialAction.Cascade); 145 | table.ForeignKey( 146 | name: "FK_AspNetUserRoles_AspNetUsers_UserId", 147 | column: x => x.UserId, 148 | principalTable: "AspNetUsers", 149 | principalColumn: "Id", 150 | onDelete: ReferentialAction.Cascade); 151 | }); 152 | 153 | migrationBuilder.CreateIndex( 154 | name: "RoleNameIndex", 155 | table: "AspNetRoles", 156 | column: "NormalizedName"); 157 | 158 | migrationBuilder.CreateIndex( 159 | name: "IX_AspNetRoleClaims_RoleId", 160 | table: "AspNetRoleClaims", 161 | column: "RoleId"); 162 | 163 | migrationBuilder.CreateIndex( 164 | name: "IX_AspNetUserClaims_UserId", 165 | table: "AspNetUserClaims", 166 | column: "UserId"); 167 | 168 | migrationBuilder.CreateIndex( 169 | name: "IX_AspNetUserLogins_UserId", 170 | table: "AspNetUserLogins", 171 | column: "UserId"); 172 | 173 | migrationBuilder.CreateIndex( 174 | name: "IX_AspNetUserRoles_RoleId", 175 | table: "AspNetUserRoles", 176 | column: "RoleId"); 177 | 178 | migrationBuilder.CreateIndex( 179 | name: "IX_AspNetUserRoles_UserId", 180 | table: "AspNetUserRoles", 181 | column: "UserId"); 182 | 183 | migrationBuilder.CreateIndex( 184 | name: "EmailIndex", 185 | table: "AspNetUsers", 186 | column: "NormalizedEmail"); 187 | 188 | migrationBuilder.CreateIndex( 189 | name: "UserNameIndex", 190 | table: "AspNetUsers", 191 | column: "NormalizedUserName", 192 | unique: true); 193 | } 194 | 195 | protected override void Down(MigrationBuilder migrationBuilder) 196 | { 197 | migrationBuilder.DropTable( 198 | name: "AspNetRoleClaims"); 199 | 200 | migrationBuilder.DropTable( 201 | name: "AspNetUserClaims"); 202 | 203 | migrationBuilder.DropTable( 204 | name: "AspNetUserLogins"); 205 | 206 | migrationBuilder.DropTable( 207 | name: "AspNetUserRoles"); 208 | 209 | migrationBuilder.DropTable( 210 | name: "AspNetUserTokens"); 211 | 212 | migrationBuilder.DropTable( 213 | name: "AspNetRoles"); 214 | 215 | migrationBuilder.DropTable( 216 | name: "AspNetUsers"); 217 | } 218 | } 219 | } 220 | -------------------------------------------------------------------------------- /src/BlogPlayground/Data/Migrations/20160910210414_update-profile.Designer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Infrastructure; 4 | using Microsoft.EntityFrameworkCore.Metadata; 5 | using Microsoft.EntityFrameworkCore.Migrations; 6 | using BlogPlayground.Data; 7 | 8 | namespace BlogPlayground.Data.Migrations 9 | { 10 | [DbContext(typeof(ApplicationDbContext))] 11 | [Migration("20160910210414_update-profile")] 12 | partial class updateprofile 13 | { 14 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 15 | { 16 | modelBuilder 17 | .HasAnnotation("ProductVersion", "1.0.0-rtm-21431") 18 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 19 | 20 | modelBuilder.Entity("BlogPlayground.Models.ApplicationUser", b => 21 | { 22 | b.Property("Id"); 23 | 24 | b.Property("AccessFailedCount"); 25 | 26 | b.Property("ConcurrencyStamp") 27 | .IsConcurrencyToken(); 28 | 29 | b.Property("Email") 30 | .HasAnnotation("MaxLength", 256); 31 | 32 | b.Property("EmailConfirmed"); 33 | 34 | b.Property("FullName"); 35 | 36 | b.Property("LockoutEnabled"); 37 | 38 | b.Property("LockoutEnd"); 39 | 40 | b.Property("NormalizedEmail") 41 | .HasAnnotation("MaxLength", 256); 42 | 43 | b.Property("NormalizedUserName") 44 | .HasAnnotation("MaxLength", 256); 45 | 46 | b.Property("PasswordHash"); 47 | 48 | b.Property("PhoneNumber"); 49 | 50 | b.Property("PhoneNumberConfirmed"); 51 | 52 | b.Property("Picture"); 53 | 54 | b.Property("SecurityStamp"); 55 | 56 | b.Property("TwoFactorEnabled"); 57 | 58 | b.Property("UserName") 59 | .HasAnnotation("MaxLength", 256); 60 | 61 | b.HasKey("Id"); 62 | 63 | b.HasIndex("NormalizedEmail") 64 | .HasName("EmailIndex"); 65 | 66 | b.HasIndex("NormalizedUserName") 67 | .IsUnique() 68 | .HasName("UserNameIndex"); 69 | 70 | b.ToTable("AspNetUsers"); 71 | }); 72 | 73 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => 74 | { 75 | b.Property("Id"); 76 | 77 | b.Property("ConcurrencyStamp") 78 | .IsConcurrencyToken(); 79 | 80 | b.Property("Name") 81 | .HasAnnotation("MaxLength", 256); 82 | 83 | b.Property("NormalizedName") 84 | .HasAnnotation("MaxLength", 256); 85 | 86 | b.HasKey("Id"); 87 | 88 | b.HasIndex("NormalizedName") 89 | .HasName("RoleNameIndex"); 90 | 91 | b.ToTable("AspNetRoles"); 92 | }); 93 | 94 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => 95 | { 96 | b.Property("Id") 97 | .ValueGeneratedOnAdd(); 98 | 99 | b.Property("ClaimType"); 100 | 101 | b.Property("ClaimValue"); 102 | 103 | b.Property("RoleId") 104 | .IsRequired(); 105 | 106 | b.HasKey("Id"); 107 | 108 | b.HasIndex("RoleId"); 109 | 110 | b.ToTable("AspNetRoleClaims"); 111 | }); 112 | 113 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => 114 | { 115 | b.Property("Id") 116 | .ValueGeneratedOnAdd(); 117 | 118 | b.Property("ClaimType"); 119 | 120 | b.Property("ClaimValue"); 121 | 122 | b.Property("UserId") 123 | .IsRequired(); 124 | 125 | b.HasKey("Id"); 126 | 127 | b.HasIndex("UserId"); 128 | 129 | b.ToTable("AspNetUserClaims"); 130 | }); 131 | 132 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => 133 | { 134 | b.Property("LoginProvider"); 135 | 136 | b.Property("ProviderKey"); 137 | 138 | b.Property("ProviderDisplayName"); 139 | 140 | b.Property("UserId") 141 | .IsRequired(); 142 | 143 | b.HasKey("LoginProvider", "ProviderKey"); 144 | 145 | b.HasIndex("UserId"); 146 | 147 | b.ToTable("AspNetUserLogins"); 148 | }); 149 | 150 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => 151 | { 152 | b.Property("UserId"); 153 | 154 | b.Property("RoleId"); 155 | 156 | b.HasKey("UserId", "RoleId"); 157 | 158 | b.HasIndex("RoleId"); 159 | 160 | b.HasIndex("UserId"); 161 | 162 | b.ToTable("AspNetUserRoles"); 163 | }); 164 | 165 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken", b => 166 | { 167 | b.Property("UserId"); 168 | 169 | b.Property("LoginProvider"); 170 | 171 | b.Property("Name"); 172 | 173 | b.Property("Value"); 174 | 175 | b.HasKey("UserId", "LoginProvider", "Name"); 176 | 177 | b.ToTable("AspNetUserTokens"); 178 | }); 179 | 180 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => 181 | { 182 | b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") 183 | .WithMany("Claims") 184 | .HasForeignKey("RoleId") 185 | .OnDelete(DeleteBehavior.Cascade); 186 | }); 187 | 188 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => 189 | { 190 | b.HasOne("BlogPlayground.Models.ApplicationUser") 191 | .WithMany("Claims") 192 | .HasForeignKey("UserId") 193 | .OnDelete(DeleteBehavior.Cascade); 194 | }); 195 | 196 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => 197 | { 198 | b.HasOne("BlogPlayground.Models.ApplicationUser") 199 | .WithMany("Logins") 200 | .HasForeignKey("UserId") 201 | .OnDelete(DeleteBehavior.Cascade); 202 | }); 203 | 204 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => 205 | { 206 | b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") 207 | .WithMany("Users") 208 | .HasForeignKey("RoleId") 209 | .OnDelete(DeleteBehavior.Cascade); 210 | 211 | b.HasOne("BlogPlayground.Models.ApplicationUser") 212 | .WithMany("Roles") 213 | .HasForeignKey("UserId") 214 | .OnDelete(DeleteBehavior.Cascade); 215 | }); 216 | } 217 | } 218 | } 219 | -------------------------------------------------------------------------------- /src/BlogPlayground/Data/Migrations/20160910210414_update-profile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.EntityFrameworkCore.Migrations; 4 | 5 | namespace BlogPlayground.Data.Migrations 6 | { 7 | public partial class updateprofile : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "FullName", 13 | table: "AspNetUsers", 14 | nullable: true); 15 | 16 | migrationBuilder.AddColumn( 17 | name: "PictureUrl", 18 | table: "AspNetUsers", 19 | nullable: true); 20 | } 21 | 22 | protected override void Down(MigrationBuilder migrationBuilder) 23 | { 24 | migrationBuilder.DropColumn( 25 | name: "FullName", 26 | table: "AspNetUsers"); 27 | 28 | migrationBuilder.DropColumn( 29 | name: "PictureUrl", 30 | table: "AspNetUsers"); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/BlogPlayground/Data/Migrations/20160913175647_articles.Designer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Infrastructure; 4 | using Microsoft.EntityFrameworkCore.Metadata; 5 | using Microsoft.EntityFrameworkCore.Migrations; 6 | using BlogPlayground.Data; 7 | 8 | namespace BlogPlayground.Data.Migrations 9 | { 10 | [DbContext(typeof(ApplicationDbContext))] 11 | [Migration("20160913175647_articles")] 12 | partial class articles 13 | { 14 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 15 | { 16 | modelBuilder 17 | .HasAnnotation("ProductVersion", "1.0.0-rtm-21431") 18 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 19 | 20 | modelBuilder.Entity("BlogPlayground.Models.ApplicationUser", b => 21 | { 22 | b.Property("Id"); 23 | 24 | b.Property("AccessFailedCount"); 25 | 26 | b.Property("ConcurrencyStamp") 27 | .IsConcurrencyToken(); 28 | 29 | b.Property("Email") 30 | .HasAnnotation("MaxLength", 256); 31 | 32 | b.Property("EmailConfirmed"); 33 | 34 | b.Property("FullName"); 35 | 36 | b.Property("LockoutEnabled"); 37 | 38 | b.Property("LockoutEnd"); 39 | 40 | b.Property("NormalizedEmail") 41 | .HasAnnotation("MaxLength", 256); 42 | 43 | b.Property("NormalizedUserName") 44 | .HasAnnotation("MaxLength", 256); 45 | 46 | b.Property("PasswordHash"); 47 | 48 | b.Property("PhoneNumber"); 49 | 50 | b.Property("PhoneNumberConfirmed"); 51 | 52 | b.Property("PictureUrl"); 53 | 54 | b.Property("SecurityStamp"); 55 | 56 | b.Property("TwoFactorEnabled"); 57 | 58 | b.Property("UserName") 59 | .HasAnnotation("MaxLength", 256); 60 | 61 | b.HasKey("Id"); 62 | 63 | b.HasIndex("NormalizedEmail") 64 | .HasName("EmailIndex"); 65 | 66 | b.HasIndex("NormalizedUserName") 67 | .IsUnique() 68 | .HasName("UserNameIndex"); 69 | 70 | b.ToTable("AspNetUsers"); 71 | }); 72 | 73 | modelBuilder.Entity("BlogPlayground.Models.Article", b => 74 | { 75 | b.Property("ArticleId") 76 | .ValueGeneratedOnAdd(); 77 | 78 | b.Property("Abstract") 79 | .IsRequired(); 80 | 81 | b.Property("AuthorId"); 82 | 83 | b.Property("Contents") 84 | .IsRequired(); 85 | 86 | b.Property("CreatedDate"); 87 | 88 | b.Property("Title") 89 | .IsRequired(); 90 | 91 | b.HasKey("ArticleId"); 92 | 93 | b.HasIndex("AuthorId"); 94 | 95 | b.ToTable("Article"); 96 | }); 97 | 98 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => 99 | { 100 | b.Property("Id"); 101 | 102 | b.Property("ConcurrencyStamp") 103 | .IsConcurrencyToken(); 104 | 105 | b.Property("Name") 106 | .HasAnnotation("MaxLength", 256); 107 | 108 | b.Property("NormalizedName") 109 | .HasAnnotation("MaxLength", 256); 110 | 111 | b.HasKey("Id"); 112 | 113 | b.HasIndex("NormalizedName") 114 | .HasName("RoleNameIndex"); 115 | 116 | b.ToTable("AspNetRoles"); 117 | }); 118 | 119 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => 120 | { 121 | b.Property("Id") 122 | .ValueGeneratedOnAdd(); 123 | 124 | b.Property("ClaimType"); 125 | 126 | b.Property("ClaimValue"); 127 | 128 | b.Property("RoleId") 129 | .IsRequired(); 130 | 131 | b.HasKey("Id"); 132 | 133 | b.HasIndex("RoleId"); 134 | 135 | b.ToTable("AspNetRoleClaims"); 136 | }); 137 | 138 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => 139 | { 140 | b.Property("Id") 141 | .ValueGeneratedOnAdd(); 142 | 143 | b.Property("ClaimType"); 144 | 145 | b.Property("ClaimValue"); 146 | 147 | b.Property("UserId") 148 | .IsRequired(); 149 | 150 | b.HasKey("Id"); 151 | 152 | b.HasIndex("UserId"); 153 | 154 | b.ToTable("AspNetUserClaims"); 155 | }); 156 | 157 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => 158 | { 159 | b.Property("LoginProvider"); 160 | 161 | b.Property("ProviderKey"); 162 | 163 | b.Property("ProviderDisplayName"); 164 | 165 | b.Property("UserId") 166 | .IsRequired(); 167 | 168 | b.HasKey("LoginProvider", "ProviderKey"); 169 | 170 | b.HasIndex("UserId"); 171 | 172 | b.ToTable("AspNetUserLogins"); 173 | }); 174 | 175 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => 176 | { 177 | b.Property("UserId"); 178 | 179 | b.Property("RoleId"); 180 | 181 | b.HasKey("UserId", "RoleId"); 182 | 183 | b.HasIndex("RoleId"); 184 | 185 | b.HasIndex("UserId"); 186 | 187 | b.ToTable("AspNetUserRoles"); 188 | }); 189 | 190 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken", b => 191 | { 192 | b.Property("UserId"); 193 | 194 | b.Property("LoginProvider"); 195 | 196 | b.Property("Name"); 197 | 198 | b.Property("Value"); 199 | 200 | b.HasKey("UserId", "LoginProvider", "Name"); 201 | 202 | b.ToTable("AspNetUserTokens"); 203 | }); 204 | 205 | modelBuilder.Entity("BlogPlayground.Models.Article", b => 206 | { 207 | b.HasOne("BlogPlayground.Models.ApplicationUser", "Author") 208 | .WithMany() 209 | .HasForeignKey("AuthorId"); 210 | }); 211 | 212 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => 213 | { 214 | b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") 215 | .WithMany("Claims") 216 | .HasForeignKey("RoleId") 217 | .OnDelete(DeleteBehavior.Cascade); 218 | }); 219 | 220 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => 221 | { 222 | b.HasOne("BlogPlayground.Models.ApplicationUser") 223 | .WithMany("Claims") 224 | .HasForeignKey("UserId") 225 | .OnDelete(DeleteBehavior.Cascade); 226 | }); 227 | 228 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => 229 | { 230 | b.HasOne("BlogPlayground.Models.ApplicationUser") 231 | .WithMany("Logins") 232 | .HasForeignKey("UserId") 233 | .OnDelete(DeleteBehavior.Cascade); 234 | }); 235 | 236 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => 237 | { 238 | b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") 239 | .WithMany("Users") 240 | .HasForeignKey("RoleId") 241 | .OnDelete(DeleteBehavior.Cascade); 242 | 243 | b.HasOne("BlogPlayground.Models.ApplicationUser") 244 | .WithMany("Roles") 245 | .HasForeignKey("UserId") 246 | .OnDelete(DeleteBehavior.Cascade); 247 | }); 248 | } 249 | } 250 | } 251 | -------------------------------------------------------------------------------- /src/BlogPlayground/Data/Migrations/20160913175647_articles.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.EntityFrameworkCore.Migrations; 4 | using Microsoft.EntityFrameworkCore.Metadata; 5 | 6 | namespace BlogPlayground.Data.Migrations 7 | { 8 | public partial class articles : Migration 9 | { 10 | protected override void Up(MigrationBuilder migrationBuilder) 11 | { 12 | migrationBuilder.CreateTable( 13 | name: "Article", 14 | columns: table => new 15 | { 16 | ArticleId = table.Column(nullable: false) 17 | .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), 18 | Abstract = table.Column(nullable: false), 19 | AuthorId = table.Column(nullable: true), 20 | Contents = table.Column(nullable: false), 21 | CreatedDate = table.Column(nullable: false), 22 | Title = table.Column(nullable: false) 23 | }, 24 | constraints: table => 25 | { 26 | table.PrimaryKey("PK_Article", x => x.ArticleId); 27 | table.ForeignKey( 28 | name: "FK_Article_AspNetUsers_AuthorId", 29 | column: x => x.AuthorId, 30 | principalTable: "AspNetUsers", 31 | principalColumn: "Id", 32 | onDelete: ReferentialAction.Restrict); 33 | }); 34 | 35 | migrationBuilder.CreateIndex( 36 | name: "IX_Article_AuthorId", 37 | table: "Article", 38 | column: "AuthorId"); 39 | } 40 | 41 | protected override void Down(MigrationBuilder migrationBuilder) 42 | { 43 | migrationBuilder.DropTable( 44 | name: "Article"); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/BlogPlayground/Data/Migrations/ApplicationDbContextModelSnapshot.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Infrastructure; 4 | using Microsoft.EntityFrameworkCore.Metadata; 5 | using Microsoft.EntityFrameworkCore.Migrations; 6 | using BlogPlayground.Data; 7 | 8 | namespace BlogPlayground.Data.Migrations 9 | { 10 | [DbContext(typeof(ApplicationDbContext))] 11 | partial class ApplicationDbContextModelSnapshot : ModelSnapshot 12 | { 13 | protected override void BuildModel(ModelBuilder modelBuilder) 14 | { 15 | modelBuilder 16 | .HasAnnotation("ProductVersion", "1.0.0-rtm-21431") 17 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 18 | 19 | modelBuilder.Entity("BlogPlayground.Models.ApplicationUser", b => 20 | { 21 | b.Property("Id"); 22 | 23 | b.Property("AccessFailedCount"); 24 | 25 | b.Property("ConcurrencyStamp") 26 | .IsConcurrencyToken(); 27 | 28 | b.Property("Email") 29 | .HasAnnotation("MaxLength", 256); 30 | 31 | b.Property("EmailConfirmed"); 32 | 33 | b.Property("FullName"); 34 | 35 | b.Property("LockoutEnabled"); 36 | 37 | b.Property("LockoutEnd"); 38 | 39 | b.Property("NormalizedEmail") 40 | .HasAnnotation("MaxLength", 256); 41 | 42 | b.Property("NormalizedUserName") 43 | .HasAnnotation("MaxLength", 256); 44 | 45 | b.Property("PasswordHash"); 46 | 47 | b.Property("PhoneNumber"); 48 | 49 | b.Property("PhoneNumberConfirmed"); 50 | 51 | b.Property("PictureUrl"); 52 | 53 | b.Property("SecurityStamp"); 54 | 55 | b.Property("TwoFactorEnabled"); 56 | 57 | b.Property("UserName") 58 | .HasAnnotation("MaxLength", 256); 59 | 60 | b.HasKey("Id"); 61 | 62 | b.HasIndex("NormalizedEmail") 63 | .HasName("EmailIndex"); 64 | 65 | b.HasIndex("NormalizedUserName") 66 | .IsUnique() 67 | .HasName("UserNameIndex"); 68 | 69 | b.ToTable("AspNetUsers"); 70 | }); 71 | 72 | modelBuilder.Entity("BlogPlayground.Models.Article", b => 73 | { 74 | b.Property("ArticleId") 75 | .ValueGeneratedOnAdd(); 76 | 77 | b.Property("Abstract") 78 | .IsRequired(); 79 | 80 | b.Property("AuthorId"); 81 | 82 | b.Property("Contents") 83 | .IsRequired(); 84 | 85 | b.Property("CreatedDate"); 86 | 87 | b.Property("Title") 88 | .IsRequired(); 89 | 90 | b.HasKey("ArticleId"); 91 | 92 | b.HasIndex("AuthorId"); 93 | 94 | b.ToTable("Article"); 95 | }); 96 | 97 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => 98 | { 99 | b.Property("Id"); 100 | 101 | b.Property("ConcurrencyStamp") 102 | .IsConcurrencyToken(); 103 | 104 | b.Property("Name") 105 | .HasAnnotation("MaxLength", 256); 106 | 107 | b.Property("NormalizedName") 108 | .HasAnnotation("MaxLength", 256); 109 | 110 | b.HasKey("Id"); 111 | 112 | b.HasIndex("NormalizedName") 113 | .HasName("RoleNameIndex"); 114 | 115 | b.ToTable("AspNetRoles"); 116 | }); 117 | 118 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => 119 | { 120 | b.Property("Id") 121 | .ValueGeneratedOnAdd(); 122 | 123 | b.Property("ClaimType"); 124 | 125 | b.Property("ClaimValue"); 126 | 127 | b.Property("RoleId") 128 | .IsRequired(); 129 | 130 | b.HasKey("Id"); 131 | 132 | b.HasIndex("RoleId"); 133 | 134 | b.ToTable("AspNetRoleClaims"); 135 | }); 136 | 137 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => 138 | { 139 | b.Property("Id") 140 | .ValueGeneratedOnAdd(); 141 | 142 | b.Property("ClaimType"); 143 | 144 | b.Property("ClaimValue"); 145 | 146 | b.Property("UserId") 147 | .IsRequired(); 148 | 149 | b.HasKey("Id"); 150 | 151 | b.HasIndex("UserId"); 152 | 153 | b.ToTable("AspNetUserClaims"); 154 | }); 155 | 156 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => 157 | { 158 | b.Property("LoginProvider"); 159 | 160 | b.Property("ProviderKey"); 161 | 162 | b.Property("ProviderDisplayName"); 163 | 164 | b.Property("UserId") 165 | .IsRequired(); 166 | 167 | b.HasKey("LoginProvider", "ProviderKey"); 168 | 169 | b.HasIndex("UserId"); 170 | 171 | b.ToTable("AspNetUserLogins"); 172 | }); 173 | 174 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => 175 | { 176 | b.Property("UserId"); 177 | 178 | b.Property("RoleId"); 179 | 180 | b.HasKey("UserId", "RoleId"); 181 | 182 | b.HasIndex("RoleId"); 183 | 184 | b.HasIndex("UserId"); 185 | 186 | b.ToTable("AspNetUserRoles"); 187 | }); 188 | 189 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken", b => 190 | { 191 | b.Property("UserId"); 192 | 193 | b.Property("LoginProvider"); 194 | 195 | b.Property("Name"); 196 | 197 | b.Property("Value"); 198 | 199 | b.HasKey("UserId", "LoginProvider", "Name"); 200 | 201 | b.ToTable("AspNetUserTokens"); 202 | }); 203 | 204 | modelBuilder.Entity("BlogPlayground.Models.Article", b => 205 | { 206 | b.HasOne("BlogPlayground.Models.ApplicationUser", "Author") 207 | .WithMany() 208 | .HasForeignKey("AuthorId"); 209 | }); 210 | 211 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => 212 | { 213 | b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") 214 | .WithMany("Claims") 215 | .HasForeignKey("RoleId") 216 | .OnDelete(DeleteBehavior.Cascade); 217 | }); 218 | 219 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => 220 | { 221 | b.HasOne("BlogPlayground.Models.ApplicationUser") 222 | .WithMany("Claims") 223 | .HasForeignKey("UserId") 224 | .OnDelete(DeleteBehavior.Cascade); 225 | }); 226 | 227 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => 228 | { 229 | b.HasOne("BlogPlayground.Models.ApplicationUser") 230 | .WithMany("Logins") 231 | .HasForeignKey("UserId") 232 | .OnDelete(DeleteBehavior.Cascade); 233 | }); 234 | 235 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => 236 | { 237 | b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") 238 | .WithMany("Users") 239 | .HasForeignKey("RoleId") 240 | .OnDelete(DeleteBehavior.Cascade); 241 | 242 | b.HasOne("BlogPlayground.Models.ApplicationUser") 243 | .WithMany("Roles") 244 | .HasForeignKey("UserId") 245 | .OnDelete(DeleteBehavior.Cascade); 246 | }); 247 | } 248 | } 249 | } 250 | -------------------------------------------------------------------------------- /src/BlogPlayground/Models/AccountViewModels/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 BlogPlayground.Models.AccountViewModels 8 | { 9 | public class ExternalLoginConfirmationViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/BlogPlayground/Models/AccountViewModels/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 BlogPlayground.Models.AccountViewModels 8 | { 9 | public class ForgotPasswordViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/BlogPlayground/Models/AccountViewModels/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 BlogPlayground.Models.AccountViewModels 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/BlogPlayground/Models/AccountViewModels/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 BlogPlayground.Models.AccountViewModels 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} and at max {1} 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/BlogPlayground/Models/AccountViewModels/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 BlogPlayground.Models.AccountViewModels 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} and at max {1} 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/BlogPlayground/Models/AccountViewModels/SendCodeViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc.Rendering; 6 | 7 | namespace BlogPlayground.Models.AccountViewModels 8 | { 9 | public class SendCodeViewModel 10 | { 11 | public string SelectedProvider { get; set; } 12 | 13 | public ICollection Providers { get; set; } 14 | 15 | public string ReturnUrl { get; set; } 16 | 17 | public bool RememberMe { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/BlogPlayground/Models/AccountViewModels/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 BlogPlayground.Models.AccountViewModels 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/BlogPlayground/Models/ApplicationUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 6 | 7 | namespace BlogPlayground.Models 8 | { 9 | // Add profile data for application users by adding properties to the ApplicationUser class 10 | public class ApplicationUser : IdentityUser 11 | { 12 | public string FullName { get; set; } 13 | public string PictureUrl { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/BlogPlayground/Models/Article.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 BlogPlayground.Models 8 | { 9 | public class Article 10 | { 11 | public int ArticleId { get; set; } 12 | [Required] 13 | public string Title { get; set; } 14 | [Required] 15 | public string Abstract { get; set; } 16 | [Required] 17 | public string Contents { get; set; } 18 | public DateTime CreatedDate { get; set; } 19 | 20 | //EF relationships should pick this relationship between Article and ApplicationUser tables: http://ef.readthedocs.io/en/latest/modeling/relationships.html 21 | public string AuthorId { get; set; } 22 | public virtual ApplicationUser Author { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/BlogPlayground/Models/ManageViewModels/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 BlogPlayground.Models.ManageViewModels 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/BlogPlayground/Models/ManageViewModels/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 BlogPlayground.Models.ManageViewModels 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} and at max {1} 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/BlogPlayground/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc.Rendering; 6 | 7 | namespace BlogPlayground.Models.ManageViewModels 8 | { 9 | public class ConfigureTwoFactorViewModel 10 | { 11 | public string SelectedProvider { get; set; } 12 | 13 | public ICollection Providers { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/BlogPlayground/Models/ManageViewModels/FactorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace BlogPlayground.Models.ManageViewModels 7 | { 8 | public class FactorViewModel 9 | { 10 | public string Purpose { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/BlogPlayground/Models/ManageViewModels/IndexViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Identity; 6 | 7 | namespace BlogPlayground.Models.ManageViewModels 8 | { 9 | public class IndexViewModel 10 | { 11 | public bool HasPassword { get; set; } 12 | 13 | public IList Logins { get; set; } 14 | 15 | public string PhoneNumber { get; set; } 16 | 17 | public bool TwoFactor { get; set; } 18 | 19 | public bool BrowserRemembered { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/BlogPlayground/Models/ManageViewModels/ManageLoginsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Http.Authentication; 6 | using Microsoft.AspNetCore.Identity; 7 | 8 | namespace BlogPlayground.Models.ManageViewModels 9 | { 10 | public class ManageLoginsViewModel 11 | { 12 | public IList CurrentLogins { get; set; } 13 | 14 | public IList OtherLogins { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/BlogPlayground/Models/ManageViewModels/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 BlogPlayground.Models.ManageViewModels 8 | { 9 | public class RemoveLoginViewModel 10 | { 11 | public string LoginProvider { get; set; } 12 | public string ProviderKey { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/BlogPlayground/Models/ManageViewModels/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 BlogPlayground.Models.ManageViewModels 8 | { 9 | public class SetPasswordViewModel 10 | { 11 | [Required] 12 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} 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/BlogPlayground/Models/ManageViewModels/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 BlogPlayground.Models.ManageViewModels 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/BlogPlayground/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace BlogPlayground 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | var host = new WebHostBuilder() 15 | .UseKestrel() 16 | .UseContentRoot(Directory.GetCurrentDirectory()) 17 | .UseIISIntegration() 18 | .UseStartup() 19 | .Build(); 20 | 21 | host.Run(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/BlogPlayground/Project_Readme.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Welcome to ASP.NET Core 6 | 127 | 128 | 129 | 130 | 138 | 139 |
140 |
141 |

This application consists of:

142 |
    143 |
  • Sample pages using ASP.NET Core MVC
  • 144 |
  • Bower for managing client-side libraries
  • 145 |
  • Theming using Bootstrap
  • 146 |
147 |
148 | 160 | 172 |
173 |

Run & Deploy

174 | 179 |
180 | 181 | 184 |
185 | 186 | 187 | 188 | -------------------------------------------------------------------------------- /src/BlogPlayground/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:64917/", 7 | "sslPort": 44310 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BlogPlayground": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "launchUrl": "http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/BlogPlayground/Services/GooglePictureLocator.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | using Newtonsoft.Json; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Net.Http; 7 | using System.Threading.Tasks; 8 | 9 | namespace BlogPlayground.Services 10 | { 11 | public class GooglePictureLocator: IGooglePictureLocator 12 | { 13 | public async Task GetProfilePictureAsync(ExternalLoginInfo info) 14 | { 15 | var accessToken = info.AuthenticationTokens.SingleOrDefault(t => t.Name == "access_token"); 16 | Uri apiRequestUri = new Uri("https://www.googleapis.com/oauth2/v2/userinfo?access_token=" + accessToken.Value); 17 | //request profile image 18 | using (var client = new HttpClient()) 19 | { 20 | var stringResponse = await client.GetStringAsync(apiRequestUri); 21 | dynamic profile = JsonConvert.DeserializeObject(stringResponse); 22 | return profile.picture; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/BlogPlayground/Services/IEmailSender.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace BlogPlayground.Services 7 | { 8 | public interface IEmailSender 9 | { 10 | Task SendEmailAsync(string email, string subject, string message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/BlogPlayground/Services/IGooglePictureLocator.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.AspNetCore.Identity; 3 | 4 | namespace BlogPlayground.Services 5 | { 6 | public interface IGooglePictureLocator 7 | { 8 | Task GetProfilePictureAsync(ExternalLoginInfo info); 9 | } 10 | } -------------------------------------------------------------------------------- /src/BlogPlayground/Services/ISmsSender.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace BlogPlayground.Services 7 | { 8 | public interface ISmsSender 9 | { 10 | Task SendSmsAsync(string number, string message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/BlogPlayground/Services/MessageServices.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace BlogPlayground.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/BlogPlayground/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 8 | using Microsoft.AspNetCore.Authentication.Google; 9 | using Microsoft.EntityFrameworkCore; 10 | using Microsoft.Extensions.Configuration; 11 | using Microsoft.Extensions.DependencyInjection; 12 | using Microsoft.Extensions.Logging; 13 | using BlogPlayground.Data; 14 | using BlogPlayground.Models; 15 | using BlogPlayground.Services; 16 | using Microsoft.AspNetCore.Authentication.OAuth; 17 | using System.Security.Claims; 18 | using Microsoft.AspNetCore.Mvc.Infrastructure; 19 | using Microsoft.Extensions.DependencyInjection.Extensions; 20 | 21 | namespace BlogPlayground 22 | { 23 | public class Startup 24 | { 25 | public Startup(IHostingEnvironment env) 26 | { 27 | var builder = new ConfigurationBuilder() 28 | .SetBasePath(env.ContentRootPath) 29 | .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) 30 | .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true); 31 | 32 | if (env.IsDevelopment()) 33 | { 34 | // For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709 35 | builder.AddUserSecrets(); 36 | } 37 | 38 | builder.AddEnvironmentVariables(); 39 | Configuration = builder.Build(); 40 | } 41 | 42 | public IConfigurationRoot Configuration { get; } 43 | 44 | // This method gets called by the runtime. Use this method to add services to the container. 45 | public void ConfigureServices(IServiceCollection services) 46 | { 47 | // Add framework services. 48 | services.AddDbContext(options => 49 | options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); 50 | 51 | services.AddIdentity() 52 | .AddEntityFrameworkStores() 53 | .AddDefaultTokenProviders(); 54 | 55 | services.AddMvc(); 56 | 57 | //Needed for accessing action context in the tag helpers 58 | services.TryAddSingleton(); 59 | 60 | // Add application services. 61 | services.AddTransient(); 62 | services.AddTransient(); 63 | services.AddTransient(); 64 | } 65 | 66 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 67 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 68 | { 69 | loggerFactory.AddConsole(Configuration.GetSection("Logging")); 70 | loggerFactory.AddDebug(); 71 | 72 | if (env.IsDevelopment()) 73 | { 74 | app.UseDeveloperExceptionPage(); 75 | app.UseDatabaseErrorPage(); 76 | app.UseBrowserLink(); 77 | } 78 | else 79 | { 80 | app.UseExceptionHandler("/Home/Error"); 81 | } 82 | 83 | 84 | app.UseStaticFiles(); 85 | 86 | app.UseIdentity(); 87 | 88 | // Add external authentication middleware below. To configure them please see http://go.microsoft.com/fwlink/?LinkID=532715 89 | app.UseGoogleAuthentication(new GoogleOptions 90 | { 91 | //Note: for safe storage of secrets, read about the Secret Manager tool at: https://docs.asp.net/en/latest/security/app-secrets.html 92 | ClientId = Configuration["GoogleClientId"] ?? "MissingClientId", 93 | ClientSecret = Configuration["GoogleClientSecret"] ?? "MissingClientSecret", 94 | SaveTokens = true, // So we get the access token and can use it later to retrieve the user profile including its picture 95 | //CallbackPath = "/signin-google", DEFAULT VALUE 96 | }); 97 | 98 | app.UseMvc(routes => 99 | { 100 | routes.MapRoute( 101 | name: "default", 102 | template: "{controller=Home}/{action=Index}/{id?}"); 103 | }); 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/BlogPlayground/TagHelpers/MarkdownTagHelper.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Razor.TagHelpers; 2 | using HeyRed.MarkdownSharp; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace BlogPlayground.TagHelpers 9 | { 10 | public class MarkdownTagHelper : TagHelper 11 | { 12 | public string Source { get; set; } 13 | 14 | public override void Process(TagHelperContext context, TagHelperOutput output) 15 | { 16 | //add wrapper span with well known class 17 | output.TagName = "div"; 18 | output.TagMode = TagMode.StartTagAndEndTag; 19 | output.Attributes.SetAttribute("class", "markdown-contents"); 20 | 21 | //Add processed markup as the inner contents. Notice the usage of SetHtmlContent so the processed markup is not encoded 22 | var markdown = new Markdown(); 23 | output.Content.SetHtmlContent(markdown.Transform(this.Source)); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/BlogPlayground/TagHelpers/ProfilePictureTagHelper.cs: -------------------------------------------------------------------------------- 1 | using BlogPlayground.Models; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.AspNetCore.Mvc.Infrastructure; 5 | using Microsoft.AspNetCore.Mvc.Rendering; 6 | using Microsoft.AspNetCore.Mvc.Routing; 7 | using Microsoft.AspNetCore.Razor.TagHelpers; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | using System.Threading.Tasks; 12 | 13 | namespace BlogPlayground.TagHelpers 14 | { 15 | public class ProfilePictureTagHelper : TagHelper 16 | { 17 | private readonly IUrlHelperFactory urlHelperFactory; 18 | private readonly IActionContextAccessor actionAccessor; 19 | 20 | public ProfilePictureTagHelper(IUrlHelperFactory urlHelperFactory, IActionContextAccessor actionAccessor) 21 | { 22 | this.urlHelperFactory = urlHelperFactory; 23 | this.actionAccessor = actionAccessor; 24 | } 25 | 26 | public ApplicationUser Profile { get; set; } 27 | public int? SizePx { get; set; } 28 | private bool IsDefaultPicture => String.IsNullOrWhiteSpace(this.Profile.PictureUrl); 29 | private IUrlHelper UrlHelper => this.urlHelperFactory.GetUrlHelper(this.actionAccessor.ActionContext); 30 | 31 | public override void Process(TagHelperContext context, TagHelperOutput output) 32 | { 33 | if (this.Profile == null) 34 | { 35 | output.SuppressOutput(); 36 | return; 37 | } 38 | 39 | //add wrapper span with well known class 40 | output.TagName = "span"; 41 | output.TagMode = TagMode.StartTagAndEndTag; 42 | output.Attributes.SetAttribute("class", "profile-picture"); 43 | 44 | //Add inner img element 45 | var img = new TagBuilder("img"); 46 | img.TagRenderMode = TagRenderMode.SelfClosing; 47 | img.Attributes.Add("title", this.GetAlternateText()); 48 | img.Attributes.Add("src", this.GetPictureUrl()); 49 | if (this.IsDefaultPicture && this.SizePx.HasValue) { 50 | img.Attributes.Add("style", $"height:{this.SizePx.Value}px;width:{this.SizePx.Value}px"); 51 | } 52 | output.Content.SetHtmlContent(img); 53 | } 54 | 55 | private string GetAlternateText() 56 | { 57 | return this.Profile.FullName ?? this.Profile.UserName; 58 | } 59 | 60 | private string GetPictureUrl() 61 | { 62 | if (this.IsDefaultPicture) 63 | { 64 | return this.UrlHelper.Content("~/images/placeholder.png"); 65 | } 66 | 67 | var imgUriBuilder = new UriBuilder(this.Profile.PictureUrl); 68 | if (this.SizePx.HasValue) 69 | { 70 | var query = QueryString.FromUriComponent(imgUriBuilder.Query); 71 | query = query.Add("sz", this.SizePx.Value.ToString()); 72 | imgUriBuilder.Query = query.ToString(); 73 | } 74 | 75 | return imgUriBuilder.Uri.ToString(); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/BlogPlayground/ViewComponents/LatestArticlesViewComponent.cs: -------------------------------------------------------------------------------- 1 | using BlogPlayground.Data; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.EntityFrameworkCore; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | 9 | namespace BlogPlayground.ViewComponents 10 | { 11 | public class LatestArticlesViewComponent: ViewComponent 12 | { 13 | private readonly ApplicationDbContext _context; 14 | 15 | public LatestArticlesViewComponent(ApplicationDbContext context) 16 | { 17 | _context = context; 18 | } 19 | 20 | public async Task InvokeAsync(int howMany = 2) 21 | { 22 | var lastArticles = await _context.Article 23 | .OrderByDescending(a => a.CreatedDate) 24 | .Take(howMany) 25 | .ToListAsync(); 26 | return View(lastArticles); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/BlogPlayground/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/BlogPlayground/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 an email address 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/BlogPlayground/Views/Account/ExternalLoginFailure.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Login Failure"; 3 | } 4 | 5 |
6 |

@ViewData["Title"].

7 |

Unsuccessful login with service.

8 |
9 | -------------------------------------------------------------------------------- /src/BlogPlayground/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/BlogPlayground/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/BlogPlayground/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/BlogPlayground/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 | 40 |
41 |
42 |
43 |
44 |
45 | 46 |
47 |
48 |

49 | Register as a new user? 50 |

51 |

52 | Forgot your password? 53 |

54 |
55 |
56 |
57 |
58 |
59 |

Use another service to log in.

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

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

70 |
71 | } 72 | else 73 | { 74 |
75 |
76 |

77 | @foreach (var provider in loginProviders) 78 | { 79 | 80 | } 81 |

82 |
83 |
84 | } 85 | } 86 |
87 |
88 |
89 | 90 | @section Scripts { 91 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 92 | } 93 | -------------------------------------------------------------------------------- /src/BlogPlayground/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/BlogPlayground/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/BlogPlayground/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/BlogPlayground/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/BlogPlayground/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/BlogPlayground/Views/Articles/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model BlogPlayground.Models.Article 2 | 3 | @{ 4 | ViewData["Title"] = "Create"; 5 | } 6 | 7 |
8 |
9 |

Create new article

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 |
42 | Back to List 43 |
44 | 45 | @section Scripts { 46 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 47 | } 48 | -------------------------------------------------------------------------------- /src/BlogPlayground/Views/Articles/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model BlogPlayground.Models.Article 2 | 3 | @{ 4 | ViewData["Title"] = "Delete"; 5 | } 6 | 7 |

Delete

8 | 9 |

Are you sure you want to delete this?

10 |
11 |

Article

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.Abstract) 16 |
17 |
18 | @Html.DisplayFor(model => model.Abstract) 19 |
20 |
21 | @Html.DisplayNameFor(model => model.Contents) 22 |
23 |
24 | @Html.DisplayFor(model => model.Contents) 25 |
26 |
27 | @Html.DisplayNameFor(model => model.CreatedDate) 28 |
29 |
30 | @Html.DisplayFor(model => model.CreatedDate) 31 |
32 |
33 | 34 |
35 |
36 | | 37 | Back to List 38 |
39 |
40 |
41 | -------------------------------------------------------------------------------- /src/BlogPlayground/Views/Articles/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model BlogPlayground.Models.Article 2 | 3 | @{ 4 | ViewData["Title"] = Model.Title; 5 | } 6 | 7 |
8 |
9 | @Html.Partial("_ArticleSummary", Model) 10 |
11 | 12 |
13 | 14 |
15 | 35 |
36 | 37 |
38 | 39 | -------------------------------------------------------------------------------- /src/BlogPlayground/Views/Articles/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewData["Title"] = "Articles"; 5 | } 6 | 7 |

This is what we have been writing...

8 | 9 |
10 |
    11 | @foreach (var article in Model) 12 | { 13 |
  • 14 | @Html.Partial("_ArticleSummary", article) 15 |
  • 16 | } 17 |
18 | 19 |
20 | 30 |
31 | 32 |
33 | -------------------------------------------------------------------------------- /src/BlogPlayground/Views/Articles/_ArticleSummary.cshtml: -------------------------------------------------------------------------------- 1 | @model BlogPlayground.Models.Article 2 | 3 |
4 |
5 | 6 |

7 | @(Model.Author.FullName ?? Model.Author.UserName) 8 |

9 |

10 | @Model.CreatedDate.ToString("dd MMM yyyy") 11 |

12 |
13 |
14 |

15 | @Model.Title 16 |

17 |
18 |

@Model.Abstract

19 |
20 |
21 |
22 | -------------------------------------------------------------------------------- /src/BlogPlayground/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "About"; 3 | } 4 |

@ViewData["Title"].

5 |

@ViewData["Message"]

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /src/BlogPlayground/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Contact"; 3 | } 4 |

@ViewData["Title"].

5 |

@ViewData["Message"]

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
18 | -------------------------------------------------------------------------------- /src/BlogPlayground/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 | 67 | 68 | 110 | -------------------------------------------------------------------------------- /src/BlogPlayground/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/BlogPlayground/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/BlogPlayground/Views/Manage/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IndexViewModel 2 | @{ 3 | ViewData["Title"] = "Manage your account"; 4 | } 5 | 6 |

@ViewData["Title"].

7 |

@ViewData["StatusMessage"]

8 | 9 |
10 |

Change your account settings

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

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

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

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

57 | @*@if (Model.TwoFactor) 58 | { 59 |
60 | Enabled 61 |
62 | } 63 | else 64 | { 65 |
66 | Disabled 67 |
68 | }*@ 69 |
70 |
71 |
72 | -------------------------------------------------------------------------------- /src/BlogPlayground/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/BlogPlayground/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/BlogPlayground/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/BlogPlayground/Views/Shared/Components/LatestArticles/Default.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 |
4 |

Latest articles:

5 |
    6 | @foreach (var article in Model) 7 | { 8 |
  • 9 | @Html.Partial("_ArticleSummary", article) 10 |
  • 11 | } 12 |
13 |
14 | 15 | -------------------------------------------------------------------------------- /src/BlogPlayground/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Error"; 3 | } 4 | 5 |

Error.

6 |

An error occurred while processing your request.

7 | 8 |

Development Mode

9 |

10 | Swapping to Development environment will display more detailed information about the error that occurred. 11 |

12 |

13 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 14 |

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

© 2016 - BlogPlayground

47 |
48 |
49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 60 | 64 | 65 | 66 | 67 | @RenderSection("scripts", required: false) 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/BlogPlayground/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Identity 2 | @using BlogPlayground.Models 3 | 4 | @inject SignInManager SignInManager 5 | @inject UserManager UserManager 6 | 7 | @if (SignInManager.IsSignedIn(User)) 8 | { 9 | var userProfile = await UserManager.GetUserAsync(User); 10 | 11 |
12 | 23 |
24 | } 25 | else 26 | { 27 | 31 | } 32 | -------------------------------------------------------------------------------- /src/BlogPlayground/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /src/BlogPlayground/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using BlogPlayground 2 | @using BlogPlayground.Models 3 | @using BlogPlayground.Models.AccountViewModels 4 | @using BlogPlayground.Models.ManageViewModels 5 | @using Microsoft.AspNetCore.Identity 6 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 7 | @addTagHelper *, BlogPlayground 8 | -------------------------------------------------------------------------------- /src/BlogPlayground/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /src/BlogPlayground/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-BlogPlayground-2f5f8325-05ef-496b-98a4-abbfaf143aac;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/BlogPlayground/bin/Debug/netcoreapp1.0/BlogPlayground.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/asp.net-core-blogging-site/c8b0e0a98e06614d66e4f926d1b8aa5051ab489e/src/BlogPlayground/bin/Debug/netcoreapp1.0/BlogPlayground.dll -------------------------------------------------------------------------------- /src/BlogPlayground/bin/Debug/netcoreapp1.0/BlogPlayground.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/asp.net-core-blogging-site/c8b0e0a98e06614d66e4f926d1b8aa5051ab489e/src/BlogPlayground/bin/Debug/netcoreapp1.0/BlogPlayground.pdb -------------------------------------------------------------------------------- /src/BlogPlayground/bin/Debug/netcoreapp1.0/BlogPlayground.runtimeconfig.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "additionalProbingPaths": [ 4 | "C:\\Users\\Daniel.Garcia\\.nuget\\packages" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /src/BlogPlayground/bin/Debug/netcoreapp1.0/BlogPlayground.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "framework": { 4 | "name": "Microsoft.NETCore.App", 5 | "version": "1.0.0" 6 | }, 7 | "configProperties": { 8 | "System.GC.Server": true 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /src/BlogPlayground/bin/Debug/netcoreapp1.0/d0958e9c-2f96-42be-8c32-48c320f1d5bc_BlogPlayground.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/asp.net-core-blogging-site/c8b0e0a98e06614d66e4f926d1b8aa5051ab489e/src/BlogPlayground/bin/Debug/netcoreapp1.0/d0958e9c-2f96-42be-8c32-48c320f1d5bc_BlogPlayground.dll -------------------------------------------------------------------------------- /src/BlogPlayground/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "asp.net", 3 | "private": true, 4 | "dependencies": { 5 | "bootstrap": "3.3.6", 6 | "jquery": "2.2.0", 7 | "jquery-validation": "1.14.0", 8 | "jquery-validation-unobtrusive": "3.2.6" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/BlogPlayground/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optinally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /src/BlogPlayground/obj/Debug/netcoreapp1.0/.IncrementalCache: -------------------------------------------------------------------------------- 1 | {"inputs":["C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\project.json","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\project.lock.json","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Program.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Startup.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Controllers\\AccountController.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Controllers\\ArticlesController.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Controllers\\HomeController.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Controllers\\ManageController.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Data\\ApplicationDbContext.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Data\\Migrations\\00000000000000_CreateIdentitySchema.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Data\\Migrations\\00000000000000_CreateIdentitySchema.Designer.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Data\\Migrations\\20160910210414_update-profile.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Data\\Migrations\\20160910210414_update-profile.Designer.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Data\\Migrations\\20160913175647_articles.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Data\\Migrations\\20160913175647_articles.Designer.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Data\\Migrations\\ApplicationDbContextModelSnapshot.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\ApplicationUser.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\Article.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\AccountViewModels\\ExternalLoginConfirmationViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\AccountViewModels\\ForgotPasswordViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\AccountViewModels\\LoginViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\AccountViewModels\\RegisterViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\AccountViewModels\\ResetPasswordViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\AccountViewModels\\SendCodeViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\AccountViewModels\\VerifyCodeViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\ManageViewModels\\AddPhoneNumberViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\ManageViewModels\\ChangePasswordViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\ManageViewModels\\ConfigureTwoFactorViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\ManageViewModels\\FactorViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\ManageViewModels\\IndexViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\ManageViewModels\\ManageLoginsViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\ManageViewModels\\RemoveLoginViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\ManageViewModels\\SetPasswordViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Models\\ManageViewModels\\VerifyPhoneNumberViewModel.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Services\\GooglePictureLocator.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Services\\IEmailSender.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Services\\IGooglePictureLocator.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Services\\ISmsSender.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\Services\\MessageServices.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\TagHelpers\\MarkdownTagHelper.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\TagHelpers\\ProfilePictureTagHelper.cs","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\ViewComponents\\LatestArticlesViewComponent.cs"],"outputs":["C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\bin\\Debug\\netcoreapp1.0\\BlogPlayground.dll","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\bin\\Debug\\netcoreapp1.0\\BlogPlayground.pdb","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\bin\\Debug\\netcoreapp1.0\\BlogPlayground.deps.json","C:\\Users\\Daniel.Garcia\\Documents\\Github\\BlogPlayground\\src\\BlogPlayground\\bin\\Debug\\netcoreapp1.0\\BlogPlayground.runtimeconfig.json"],"buildArguments":{"version-suffix":null}} -------------------------------------------------------------------------------- /src/BlogPlayground/obj/Debug/netcoreapp1.0/.SDKVersion: -------------------------------------------------------------------------------- 1 | 1e9d529bc54ed49f33102199e109526ea9c6b3c4 2 | 1.0.0-preview2-003121 3 | 4 | win7-x64 -------------------------------------------------------------------------------- /src/BlogPlayground/obj/Debug/netcoreapp1.0/dotnet-compile.assemblyinfo.cs: -------------------------------------------------------------------------------- 1 | // This file has been auto generated. 2 | [assembly:System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 3 | [assembly:System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 4 | [assembly:System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 5 | [assembly:System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v1.0")] -------------------------------------------------------------------------------- /src/BlogPlayground/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "userSecretsId": "aspnet-BlogPlayground-2f5f8325-05ef-496b-98a4-abbfaf143aac", 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-preview2-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.SqlServer.Design": { 23 | "version": "1.0.0", 24 | "type": "build" 25 | }, 26 | "Microsoft.EntityFrameworkCore.Tools": { 27 | "version": "1.0.0-preview2-final", 28 | "type": "build" 29 | }, 30 | "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", 31 | "Microsoft.Extensions.Configuration.Json": "1.0.0", 32 | "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0", 33 | "Microsoft.Extensions.Logging": "1.0.0", 34 | "Microsoft.Extensions.Logging.Console": "1.0.0", 35 | "Microsoft.Extensions.Logging.Debug": "1.0.0", 36 | "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0", 37 | "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0", 38 | "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { 39 | "version": "1.0.0-preview2-final", 40 | "type": "build" 41 | }, 42 | "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { 43 | "version": "1.0.0-preview2-final", 44 | "type": "build" 45 | }, 46 | "Microsoft.AspNetCore.Authentication.Google": "1.0.0", 47 | "Markdown": "2.2.0", 48 | "Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final" 49 | }, 50 | 51 | "tools": { 52 | "BundlerMinifier.Core": "2.0.238", 53 | "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final", 54 | "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final", 55 | "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final", 56 | "Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final", 57 | "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { 58 | "version": "1.0.0-preview2-final", 59 | "imports": [ 60 | "portable-net45+win8" 61 | ] 62 | } 63 | }, 64 | 65 | "frameworks": { 66 | "netcoreapp1.0": { 67 | "imports": [ 68 | "dotnet5.6", 69 | "portable-net45+win8" 70 | ] 71 | } 72 | }, 73 | 74 | "buildOptions": { 75 | "emitEntryPoint": true, 76 | "preserveCompilationContext": true 77 | }, 78 | 79 | "runtimeOptions": { 80 | "configProperties": { 81 | "System.GC.Server": true 82 | } 83 | }, 84 | 85 | "publishOptions": { 86 | "include": [ 87 | "wwwroot", 88 | "Views", 89 | "Areas/**/Views", 90 | "appsettings.json", 91 | "web.config" 92 | ] 93 | }, 94 | 95 | "scripts": { 96 | "prepublish": [ "bower install", "dotnet bundle" ], 97 | "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/BlogPlayground/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | -------------------------------------------------------------------------------- /src/BlogPlayground/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 | max-width: 280px; 17 | } 18 | 19 | /* Carousel */ 20 | .carousel-caption p { 21 | font-size: 20px; 22 | line-height: 1.4; 23 | } 24 | 25 | /* buttons and links extension to use brackets: [ click me ] */ 26 | .btn-bracketed::before { 27 | display:inline-block; 28 | content: "["; 29 | padding-right: 0.5em; 30 | } 31 | .btn-bracketed::after { 32 | display:inline-block; 33 | content: "]"; 34 | padding-left: 0.5em; 35 | } 36 | 37 | /* Make .svg files in the carousel display properly in older browsers */ 38 | .carousel-inner .item img[src$=".svg"] 39 | { 40 | width: 100%; 41 | } 42 | 43 | /*Profile picture*/ 44 | .profile-picture img{ 45 | vertical-align: middle; 46 | border-radius: 50%; 47 | } 48 | 49 | /*Navbar*/ 50 | .navbar .profile-picture { 51 | line-height: 50px; 52 | } 53 | 54 | /*Articles*/ 55 | .article-summary .profile-picture img{ 56 | display: block; 57 | margin: 0 auto; 58 | } 59 | 60 | .article-summary .col-md-4{ 61 | margin-top: 5px; 62 | } 63 | 64 | .article-summary .author-name{ 65 | margin: 10px 0 0 0; 66 | } 67 | 68 | .article-list{ 69 | margin-top: 10px; 70 | } 71 | 72 | .article-list, 73 | .article-details { 74 | border-right: 1px solid #eee; 75 | } 76 | 77 | .article-page{ 78 | margin-top: 20px; 79 | } 80 | 81 | .last-articles { 82 | margin-top: 10px; 83 | padding-top: 10px; 84 | } 85 | 86 | .last-articles-list blockquote { 87 | font-size: 14px; 88 | } 89 | 90 | /* Hide/rearrange for smaller screens */ 91 | @media screen and (max-width: 767px) { 92 | /* Hide captions */ 93 | .carousel-caption { 94 | display: none 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.btn-bracketed::before{display:inline-block;content:"[";padding-right:.5em}.btn-bracketed::after{display:inline-block;content:"]";padding-left:.5em}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/asp.net-core-blogging-site/c8b0e0a98e06614d66e4f926d1b8aa5051ab489e/src/BlogPlayground/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/images/banner1.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/images/banner2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/images/banner3.svg: -------------------------------------------------------------------------------- 1 | banner3b -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/images/banner4.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/images/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/asp.net-core-blogging-site/c8b0e0a98e06614d66e4f926d1b8aa5051ab489e/src/BlogPlayground/wwwroot/images/placeholder.png -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your Javascript code. 2 | -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/asp.net-core-blogging-site/c8b0e0a98e06614d66e4f926d1b8aa5051ab489e/src/BlogPlayground/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /src/BlogPlayground/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 - 2" 33 | }, 34 | "version": "3.3.6", 35 | "_release": "3.3.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.6", 39 | "commit": "81df608a40bf0629a1dc08e584849bb1e43e0b7a" 40 | }, 41 | "_source": "git://github.com/twbs/bootstrap.git", 42 | "_target": "3.3.6", 43 | "_originalSource": "bootstrap" 44 | } -------------------------------------------------------------------------------- /src/BlogPlayground/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/BlogPlayground/wwwroot/lib/bootstrap/dist/css/bootstrap-theme.min.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["less/theme.less","less/mixins/vendor-prefixes.less","less/mixins/gradients.less","less/mixins/reset-filter.less"],"names":[],"mappings":";;;;AAmBA,YAAA,aAAA,UAAA,aAAA,aAAA,aAME,YAAA,EAAA,KAAA,EAAA,eC2CA,mBAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,iBDvCR,mBAAA,mBAAA,oBAAA,oBAAA,iBAAA,iBAAA,oBAAA,oBAAA,oBAAA,oBAAA,oBAAA,oBCsCA,mBAAA,MAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,MAAA,EAAA,IAAA,IAAA,iBDlCR,qBAAA,sBAAA,sBAAA,uBAAA,mBAAA,oBAAA,sBAAA,uBAAA,sBAAA,uBAAA,sBAAA,uBAAA,+BAAA,gCAAA,6BAAA,gCAAA,gCAAA,gCCiCA,mBAAA,KACQ,WAAA,KDlDV,mBAAA,oBAAA,iBAAA,oBAAA,oBAAA,oBAuBI,YAAA,KAyCF,YAAA,YAEE,iBAAA,KAKJ,aErEI,YAAA,EAAA,IAAA,EAAA,KACA,iBAAA,iDACA,iBAAA,4CAAA,iBAAA,qEAEA,iBAAA,+CCnBF,OAAA,+GH4CA,OAAA,0DACA,kBAAA,SAuC2C,aAAA,QAA2B,aAAA,KArCtE,mBAAA,mBAEE,iBAAA,QACA,oBAAA,EAAA,MAGF,oBAAA,oBAEE,iBAAA,QACA,aAAA,QAMA,sBAAA,6BAAA,4BAAA,6BAAA,4BAAA,4BAAA,uBAAA,8BAAA,6BAAA,8BAAA,6BAAA,6BAAA,gCAAA,uCAAA,sCAAA,uCAAA,sCAAA,sCAME,iBAAA,QACA,iBAAA,KAgBN,aEtEI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDAEA,OAAA,+GCnBF,OAAA,0DH4CA,kBAAA,SACA,aAAA,QAEA,mBAAA,mBAEE,iBAAA,QACA,oBAAA,EAAA,MAGF,oBAAA,oBAEE,iBAAA,QACA,aAAA,QAMA,sBAAA,6BAAA,4BAAA,6BAAA,4BAAA,4BAAA,uBAAA,8BAAA,6BAAA,8BAAA,6BAAA,6BAAA,gCAAA,uCAAA,sCAAA,uCAAA,sCAAA,sCAME,iBAAA,QACA,iBAAA,KAiBN,aEvEI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDAEA,OAAA,+GCnBF,OAAA,0DH4CA,kBAAA,SACA,aAAA,QAEA,mBAAA,mBAEE,iBAAA,QACA,oBAAA,EAAA,MAGF,oBAAA,oBAEE,iBAAA,QACA,aAAA,QAMA,sBAAA,6BAAA,4BAAA,6BAAA,4BAAA,4BAAA,uBAAA,8BAAA,6BAAA,8BAAA,6BAAA,6BAAA,gCAAA,uCAAA,sCAAA,uCAAA,sCAAA,sCAME,iBAAA,QACA,iBAAA,KAkBN,UExEI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDAEA,OAAA,+GCnBF,OAAA,0DH4CA,kBAAA,SACA,aAAA,QAEA,gBAAA,gBAEE,iBAAA,QACA,oBAAA,EAAA,MAGF,iBAAA,iBAEE,iBAAA,QACA,aAAA,QAMA,mBAAA,0BAAA,yBAAA,0BAAA,yBAAA,yBAAA,oBAAA,2BAAA,0BAAA,2BAAA,0BAAA,0BAAA,6BAAA,oCAAA,mCAAA,oCAAA,mCAAA,mCAME,iBAAA,QACA,iBAAA,KAmBN,aEzEI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDAEA,OAAA,+GCnBF,OAAA,0DH4CA,kBAAA,SACA,aAAA,QAEA,mBAAA,mBAEE,iBAAA,QACA,oBAAA,EAAA,MAGF,oBAAA,oBAEE,iBAAA,QACA,aAAA,QAMA,sBAAA,6BAAA,4BAAA,6BAAA,4BAAA,4BAAA,uBAAA,8BAAA,6BAAA,8BAAA,6BAAA,6BAAA,gCAAA,uCAAA,sCAAA,uCAAA,sCAAA,sCAME,iBAAA,QACA,iBAAA,KAoBN,YE1EI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDAEA,OAAA,+GCnBF,OAAA,0DH4CA,kBAAA,SACA,aAAA,QAEA,kBAAA,kBAEE,iBAAA,QACA,oBAAA,EAAA,MAGF,mBAAA,mBAEE,iBAAA,QACA,aAAA,QAMA,qBAAA,4BAAA,2BAAA,4BAAA,2BAAA,2BAAA,sBAAA,6BAAA,4BAAA,6BAAA,4BAAA,4BAAA,+BAAA,sCAAA,qCAAA,sCAAA,qCAAA,qCAME,iBAAA,QACA,iBAAA,KA2BN,eAAA,WClCE,mBAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,EAAA,IAAA,IAAA,iBD2CV,0BAAA,0BE3FI,iBAAA,QACA,iBAAA,oDACA,iBAAA,+CAAA,iBAAA,wEACA,iBAAA,kDACA,OAAA,+GF0FF,kBAAA,SAEF,yBAAA,+BAAA,+BEhGI,iBAAA,QACA,iBAAA,oDACA,iBAAA,+CAAA,iBAAA,wEACA,iBAAA,kDACA,OAAA,+GFgGF,kBAAA,SASF,gBE7GI,iBAAA,iDACA,iBAAA,4CACA,iBAAA,qEAAA,iBAAA,+CACA,OAAA,+GACA,OAAA,0DCnBF,kBAAA,SH+HA,cAAA,ICjEA,mBAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,iBD6DV,sCAAA,oCE7GI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SD2CF,mBAAA,MAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,MAAA,EAAA,IAAA,IAAA,iBD0EV,cAAA,iBAEE,YAAA,EAAA,IAAA,EAAA,sBAIF,gBEhII,iBAAA,iDACA,iBAAA,4CACA,iBAAA,qEAAA,iBAAA,+CACA,OAAA,+GACA,OAAA,0DCnBF,kBAAA,SHkJA,cAAA,IAHF,sCAAA,oCEhII,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SD2CF,mBAAA,MAAA,EAAA,IAAA,IAAA,gBACQ,WAAA,MAAA,EAAA,IAAA,IAAA,gBDgFV,8BAAA,iCAYI,YAAA,EAAA,KAAA,EAAA,gBAKJ,qBAAA,kBAAA,mBAGE,cAAA,EAqBF,yBAfI,mDAAA,yDAAA,yDAGE,MAAA,KE7JF,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,UFqKJ,OACE,YAAA,EAAA,IAAA,EAAA,qBC3HA,mBAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,gBACQ,WAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,gBDsIV,eEtLI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF8KF,aAAA,QAKF,YEvLI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF8KF,aAAA,QAMF,eExLI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF8KF,aAAA,QAOF,cEzLI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF8KF,aAAA,QAeF,UEjMI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFuMJ,cE3MI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFwMJ,sBE5MI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFyMJ,mBE7MI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF0MJ,sBE9MI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF2MJ,qBE/MI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF+MJ,sBElLI,iBAAA,yKACA,iBAAA,oKACA,iBAAA,iKFyLJ,YACE,cAAA,IC9KA,mBAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,EAAA,IAAA,IAAA,iBDgLV,wBAAA,8BAAA,8BAGE,YAAA,EAAA,KAAA,EAAA,QEnOE,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFiOF,aAAA,QALF,+BAAA,qCAAA,qCAQI,YAAA,KAUJ,OCnME,mBAAA,EAAA,IAAA,IAAA,gBACQ,WAAA,EAAA,IAAA,IAAA,gBD4MV,8BE5PI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFyPJ,8BE7PI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF0PJ,8BE9PI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF2PJ,2BE/PI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF4PJ,8BEhQI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF6PJ,6BEjQI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFoQJ,MExQI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFsQF,aAAA,QC3NA,mBAAA,MAAA,EAAA,IAAA,IAAA,gBAAA,EAAA,IAAA,EAAA,qBACQ,WAAA,MAAA,EAAA,IAAA,IAAA,gBAAA,EAAA,IAAA,EAAA"} -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/asp.net-core-blogging-site/c8b0e0a98e06614d66e4f926d1b8aa5051ab489e/src/BlogPlayground/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/asp.net-core-blogging-site/c8b0e0a98e06614d66e4f926d1b8aa5051ab489e/src/BlogPlayground/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/asp.net-core-blogging-site/c8b0e0a98e06614d66e4f926d1b8aa5051ab489e/src/BlogPlayground/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/asp.net-core-blogging-site/c8b0e0a98e06614d66e4f926d1b8aa5051ab489e/src/BlogPlayground/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/BlogPlayground/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/BlogPlayground/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "version": "3.2.6", 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.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.2.6", 39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7" 40 | }, 41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git", 42 | "_target": "3.2.6", 43 | "_originalSource": "jquery-validation-unobtrusive" 44 | } -------------------------------------------------------------------------------- /src/BlogPlayground/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/BlogPlayground/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/BlogPlayground/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/BlogPlayground/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /src/BlogPlayground/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | --------------------------------------------------------------------------------