Setting up for a Multi Tenant Angular and Asp.Net Core 2.0 Web Api Application

Background I am looking to do a project that allows Multi Tenant access to a SPA created in Angular.  I will use Asp.Net Core 2.0 Web Api for the rest calls.  For this walk-through I will be keeping the Api and the UI projects separate.  Unlike most examples that I have found, I will not be putting the UI into…

Read more »

EF Core and Defeating The Self Referencing Loop

I have come across an error “Self referencing loop detected for property…..” when working with EF Core. Turns out, EF is trying to return data that inherently has a self-referencing loop. The Json serializer is trying to take your object graph and create a hierarchy. For example, say we have an object called Order, an object called Product, and an…

Read more »

Linux-based SQL Server in Docker Containers

I have been really liking what Docker can offer and have been experimenting with it whenever possible.  In the July issue of MSDN magazine, Julie Lerman wrote about using SQL Server in a Docker container. Article:  https://msdn.microsoft.com/en-us/magazine/mt784660.aspx I had been going through the article carefully but using a Windows machine.  When it came time to interact with the SQL Server…

Read more »

Import Database into Sql Server Database Project

This article is a continuation of the customized Asp.Net Identity database that was created in previous posts. Create The Project Start by creating a SQL Server Database Project.  To go along with the scenario we set up for creating our database in the first place, I have chosen to name the project ApothecaricIdentityDatatbase. With this project we will be able…

Read more »

Multi-App Support For Asp.Net Identity – Part 6

Let’s Run Some EF Migrations Already! Now we will run the EF Code First Migrations and build our database……Finally!! To run the migrations, we will need a the Nuget Package Manager Console. Now we will have to enable the Migrations.  In the Package Manager Console, type in “enable-migrations” And if all went well, you should see this: You should now…

Read more »

Multi-App Support For Asp.Net Identity – Part 5

Cross Reference / Join / Junction Table I would like to associate the new AspNetApplications table to the users table.  If I want a user to be allowed access to multiple Applications and I want Applications to be assigned to many users, I have a Many-To-Many relationship.  Now I can’t just associate my Applications table and my Users table directly. …

Read more »

Multi-App Support For Asp.Net Identity – Part 4

Add New Table Now let’s add a whole new table.  Let’s add an Applications table to house our application information.  We will tie this table to our users in a later post.  For now, let’s just get the new table in place. Let’s look back at our IdentityModels.cs file.   We need to add another using statement to our IdentityModels.cs…

Read more »

Multi-App Support For Asp.Net Identity – Part 3

Add Fields to User Table Now I would like to add 3 fields to the AspNetUser that will be created for us.  In addition to the login information, I would like to  add a First Name field, Last Name field, and an Employee Number field to the table. For simplicity sake, I would just want all the new fields to…

Read more »

Multi-App Support For Asp.Net Identity – Part 2

Set The Stage So let’s set the what and why we will be doing.  Our fictitious company, Apothecaric Consulting is a small consulting firm with a few employees and a few subcontractors.  Apothecaric would like to create an application for employees and subcontractors to submit timesheets for the projects they are working on.  Apothecaric would also like to be able…

Read more »

Multi-App Support For Asp.Net Identity – Part 1

So I was thinking about how a small organization could leverage single-sign-on without having to leverage a larger Identity server implementation such as Thinktecture’s Identity Server 3. I reserve the right to change my mind and change course, but for now, I am looking to leverage Asp.Net’s Identity database to manage users and the applications the users are granted access…

Read more »