This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace efcore_tenancy.Infrastructure | |
{ | |
public class TenantInfo | |
{ | |
public string Name { get; set; } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Data.Common; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.EntityFrameworkCore.Diagnostics; | |
using Microsoft.Extensions.DependencyInjection; | |
namespace efcore_tenancy.Infrastructure | |
{ | |
public class DiscriminatorColumnInterceptor : DbCommandInterceptor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Data.Common; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.EntityFrameworkCore.Diagnostics; | |
namespace efcore_tenancy.Infrastructure | |
{ | |
public class SchemaInterceptor : DbCommandInterceptor | |
{ | |
private readonly TenantInfo tenantInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Reflection; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.Controllers; | |
using Microsoft.Extensions.DependencyInjection; | |
namespace auth.api | |
{ | |
public static class MvcExtensions | |
{ | |
public static IMvcBuilder AddControllersFromRouteBranch(this IMvcBuilder builder, Assembly Assembly, string route) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using auth.api.Services; | |
using auth.api.Security; | |
using auth.api.Security.MyDb; | |
using Microsoft.AspNetCore.Http; | |
using WebApiContrib.Core; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using System.Reflection; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.Controllers; | |
namespace auth.api | |
{ | |
public class RouteBranchControllerFeatureProvider : ControllerFeatureProvider | |
{ | |
private readonly string route; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using auth.api.Security; | |
using Microsoft.AspNetCore.Authorization; | |
using Microsoft.AspNetCore.Mvc; | |
namespace auth.api.Controllers | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using auth.api.Security; | |
using Microsoft.AspNetCore.Authorization; | |
using Microsoft.AspNetCore.Mvc; | |
namespace auth.api.Controllers | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using auth.api.Security; | |
using Microsoft.AspNetCore.Authorization; | |
using Microsoft.AspNetCore.Mvc; | |
namespace auth.api.Controllers | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace auth.api | |
{ | |
[System.AttributeUsage(System.AttributeTargets.Class, Inherited = false, AllowMultiple = false)] | |
sealed class RouteBranchAttribute : System.Attribute | |
{ | |
// See the attribute guidelines at | |
// http://go.microsoft.com/fwlink/?LinkId=85236 | |
readonly string route; | |
// This is a positional argument |