Skip to main content

Posts

Showing posts from December, 2017

Create aspnet core 2.0 Identity entity framework Sql Server database schema

When running aspnet core 2.0 identity application, I have encountered the error "invalid object AspNetUsers", which means the database table is not created. In order to create database schema required by aspnet core 2.o identity framework, following these steps: 1. In your project, create data context related to identity: public class UserDbContext : IdentityDbContext < IdentityUser > { public UserDbContext (DbContextOptions< UserDbContext > options) : base (options) { } protected override void OnModelCreating( ModelBuilder builder) { base .OnModelCreating(builder); } } 2. In Startup.cs file, configure the Identity store and UserDbContext entity framework: var secretKey = Configuration.GetSection("JWTSettings:SecretKey").Value; var issuer = Configuration.GetSection("JWTSettings:Issuer").Value; var audience = Configuration.GetSection("JWTSet

Define multiple Angular apps in MVC layout and content page

Here is the situation I encountered: I have a MVC application, in layout.cshtml file, I have a header logo and footer logo and I want the logos to be dynamic based on the client information passed in. Here is my layout page: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>For your security - Mercer.MFA.SharedUI</title> <base href="~/" /> <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" /> <link rel="stylesheet" href="~/css/magic-check.css" /> <link rel="stylesheet" href="~/css/site.css" /> </head> <body> <div class="container"> <header ng-app=" headerApp " ng-controller=" headerCtrl "> <div class="row"> <div class="col-md-6 header_left"