Multi-tenancy support for the Identity module.

pull/216/head
Halil İbrahim Kalkan 8 years ago
parent 3d68f3fcfa
commit b8cb698dc2

@ -124,7 +124,7 @@ namespace Volo.Abp.Account.Web.Pages.Account
{
var emailAddress = info.Principal.FindFirstValue(ClaimTypes.Email);
var user = new IdentityUser(GuidGenerator.Create(), emailAddress);
var user = new IdentityUser(GuidGenerator.Create(), emailAddress, CurrentTenant.Id);
CheckIdentityErrors(await _userManager.CreateAsync(user));
CheckIdentityErrors(await _userManager.SetEmailAsync(user, emailAddress));

@ -38,7 +38,7 @@ namespace Volo.Abp.Account.Web.Pages.Account
throw new NotImplementedException();
}
var user = new IdentityUser(GuidGenerator.Create(), input.UserName);
var user = new IdentityUser(GuidGenerator.Create(), input.UserName, CurrentTenant.Id);
var result = await _userManager.CreateAsync(user, input.Password);

@ -5,7 +5,9 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.AspNetCore.Mvc.Validation;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
using Volo.Abp.ObjectMapping;
using Volo.Abp.Session;
using Volo.Abp.Uow;
namespace Volo.Abp.AspNetCore.Mvc.RazorPages
@ -20,6 +22,10 @@ namespace Volo.Abp.AspNetCore.Mvc.RazorPages
public ILoggerFactory LoggerFactory { get; set; }
public ICurrentUser CurrentUser { get; set; }
public ICurrentTenant CurrentTenant { get; set; }
public IModelStateValidator ModelValidator { get; set; }
protected IUnitOfWork CurrentUnitOfWork => UnitOfWorkManager?.Current;

@ -46,7 +46,7 @@ namespace Volo.Abp.Identity
public async Task<IdentityRoleDto> CreateAsync(IdentityRoleCreateDto input)
{
var role = new IdentityRole(GuidGenerator.Create(), input.Name);
var role = new IdentityRole(GuidGenerator.Create(), input.Name, CurrentTenant.Id);
await _roleManager.CreateAsync(role);
await CurrentUnitOfWork.SaveChangesAsync();

@ -36,7 +36,7 @@ namespace Volo.Abp.Identity
public async Task<IdentityUserDto> CreateAsync(IdentityUserCreateDto input)
{
var user = new IdentityUser(GuidGenerator.Create(), input.UserName);
var user = new IdentityUser(GuidGenerator.Create(), input.UserName, CurrentTenant.Id);
CheckIdentityErrors(await _userManager.CreateAsync(user, input.Password));
await UpdateUserByInput(user, input);

@ -2,11 +2,14 @@
using System.Security.Claims;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Identity
{
public abstract class IdentityClaim : Entity<Guid>
public abstract class IdentityClaim : Entity<Guid>, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
/// <summary>
/// Gets or sets the claim type for this claim.
/// </summary>
@ -22,19 +25,20 @@ namespace Volo.Abp.Identity
}
protected internal IdentityClaim(Guid id, [NotNull] Claim claim)
: this(id, claim.Type, claim.Value)
protected internal IdentityClaim(Guid id, [NotNull] Claim claim, Guid? tenantId)
: this(id, claim.Type, claim.Value, tenantId)
{
}
protected internal IdentityClaim(Guid id, [NotNull] string claimType, string claimValue)
protected internal IdentityClaim(Guid id, [NotNull] string claimType, string claimValue, Guid? tenantId)
{
Check.NotNull(claimType, nameof(claimType));
Id = id;
ClaimType = claimType;
ClaimValue = claimValue;
TenantId = tenantId;
}
/// <summary>

@ -5,14 +5,17 @@ using System.Security.Claims;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Identity
{
/// <summary>
/// Represents a role in the identity system
/// </summary>
public class IdentityRole : AggregateRoot<Guid>, IHasConcurrencyStamp
public class IdentityRole : AggregateRoot<Guid>, IHasConcurrencyStamp, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
/// <summary>
/// Gets or sets the name for this role.
/// </summary>
@ -38,17 +41,13 @@ namespace Volo.Abp.Identity
/// </summary>
protected IdentityRole() { }
/// <summary>
/// Initializes a new instance of <see cref="IdentityRole"/>.
/// </summary>
/// <param name="id">Role id.</param>
/// <param name="name">The role name.</param>
public IdentityRole(Guid id, [NotNull] string name)
public IdentityRole(Guid id, [NotNull] string name, Guid? tenantId = null)
{
Check.NotNull(name, nameof(name));
Id = id;
Name = name;
TenantId = tenantId;
NormalizedName = name.ToUpperInvariant();
ConcurrencyStamp = Guid.NewGuid().ToString();
@ -60,7 +59,7 @@ namespace Volo.Abp.Identity
Check.NotNull(guidGenerator, nameof(guidGenerator));
Check.NotNull(claim, nameof(claim));
Claims.Add(new IdentityRoleClaim(guidGenerator.Create(), Id, claim));
Claims.Add(new IdentityRoleClaim(guidGenerator.Create(), Id, claim, TenantId));
}
public virtual void AddClaims([NotNull] IGuidGenerator guidGenerator, [NotNull] IEnumerable<Claim> claims)

@ -19,14 +19,30 @@ namespace Volo.Abp.Identity
}
protected internal IdentityRoleClaim(Guid id, Guid roleId, [NotNull] Claim claim)
: base(id, claim)
protected internal IdentityRoleClaim(
Guid id,
Guid roleId,
[NotNull] Claim claim,
Guid? tenantId)
: base(
id,
claim,
tenantId)
{
RoleId = roleId;
}
protected internal IdentityRoleClaim(Guid id, Guid roleId, [NotNull] string claimType, string claimValue)
: base(id, claimType, claimValue)
protected internal IdentityRoleClaim(
Guid id,
Guid roleId,
[NotNull] string claimType,
string claimValue,
Guid? tenantId)
: base(
id,
claimType,
claimValue,
tenantId)
{
RoleId = roleId;
}

@ -7,11 +7,14 @@ using JetBrains.Annotations;
using Microsoft.AspNetCore.Identity;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Identity
{
public class IdentityUser : AggregateRoot<Guid>, IHasConcurrencyStamp
public class IdentityUser : AggregateRoot<Guid>, IHasConcurrencyStamp, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
/// <summary>
/// Gets or sets the user name for this user.
/// </summary>
@ -116,11 +119,12 @@ namespace Volo.Abp.Identity
}
public IdentityUser(Guid id, [NotNull] string userName)
public IdentityUser(Guid id, [NotNull] string userName, Guid? tenantId = null)
{
Check.NotNull(userName, nameof(userName));
Id = id;
TenantId = tenantId;
UserName = userName;
NormalizedUserName = userName.ToUpperInvariant();
ConcurrencyStamp = Guid.NewGuid().ToString();
@ -141,7 +145,7 @@ namespace Volo.Abp.Identity
return;
}
Roles.Add(new IdentityUserRole(Id, roleId));
Roles.Add(new IdentityUserRole(Id, roleId, TenantId));
}
public virtual void RemoveRole(Guid roleId)
@ -168,7 +172,7 @@ namespace Volo.Abp.Identity
Check.NotNull(guidGenerator, nameof(guidGenerator));
Check.NotNull(claim, nameof(claim));
Claims.Add(new IdentityUserClaim(guidGenerator.Create(), Id, claim));
Claims.Add(new IdentityUserClaim(guidGenerator.Create(), Id, claim, TenantId));
}
public virtual void AddClaims([NotNull] IGuidGenerator guidGenerator, [NotNull] IEnumerable<Claim> claims)
@ -215,7 +219,7 @@ namespace Volo.Abp.Identity
{
Check.NotNull(login, nameof(login));
Logins.Add(new IdentityUserLogin(Id, login));
Logins.Add(new IdentityUserLogin(Id, login, TenantId));
}
public virtual void RemoveLogin([NotNull] string loginProvider, [NotNull] string providerKey)
@ -237,7 +241,7 @@ namespace Volo.Abp.Identity
var token = FindToken(loginProvider, name);
if (token == null)
{
Tokens.Add(new IdentityUserToken(Id, loginProvider, name, value));
Tokens.Add(new IdentityUserToken(Id, loginProvider, name, value, TenantId));
}
else
{

@ -19,15 +19,14 @@ namespace Volo.Abp.Identity
}
protected internal IdentityUserClaim(Guid id, Guid userId, [NotNull] Claim claim)
: base(id, claim)
protected internal IdentityUserClaim(Guid id, Guid userId, [NotNull] Claim claim, Guid? tenantId)
: base(id, claim, tenantId)
{
UserId = userId;
}
protected internal IdentityUserClaim(Guid id, Guid userId, [NotNull] string claimType, string claimValue)
: base(id, claimType, claimValue)
protected internal IdentityUserClaim(Guid id, Guid userId, [NotNull] string claimType, string claimValue, Guid? tenantId)
: base(id, claimType, claimValue, tenantId)
{
UserId = userId;
}

@ -2,14 +2,17 @@ using System;
using JetBrains.Annotations;
using Microsoft.AspNetCore.Identity;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Identity
{
/// <summary>
/// Represents a login and its associated provider for a user.
/// </summary>
public class IdentityUserLogin : Entity
public class IdentityUserLogin : Entity, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
/// <summary>
/// Gets or sets the of the primary key of the user associated with this login.
/// </summary>
@ -35,7 +38,12 @@ namespace Volo.Abp.Identity
}
protected internal IdentityUserLogin(Guid userId, [NotNull] string loginProvider, [NotNull] string providerKey, string providerDisplayName)
protected internal IdentityUserLogin(
Guid userId,
[NotNull] string loginProvider,
[NotNull] string providerKey,
string providerDisplayName,
Guid? tenantId)
{
Check.NotNull(loginProvider, nameof(loginProvider));
Check.NotNull(providerKey, nameof(providerKey));
@ -44,12 +52,20 @@ namespace Volo.Abp.Identity
LoginProvider = loginProvider;
ProviderKey = providerKey;
ProviderDisplayName = providerDisplayName;
TenantId = tenantId;
}
protected internal IdentityUserLogin(Guid userId, [NotNull] UserLoginInfo login)
: this(userId, login.LoginProvider, login.ProviderKey, login.ProviderDisplayName)
protected internal IdentityUserLogin(
Guid userId,
[NotNull] UserLoginInfo login,
Guid? tenantId)
: this(
userId,
login.LoginProvider,
login.ProviderKey,
login.ProviderDisplayName,
tenantId)
{
}
public UserLoginInfo ToUserLoginInfo()

@ -1,13 +1,16 @@
using System;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Identity
{
/// <summary>
/// Represents the link between a user and a role.
/// </summary>
public class IdentityUserRole : Entity
public class IdentityUserRole : Entity, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
/// <summary>
/// Gets or sets the primary key of the user that is linked to a role.
/// </summary>
@ -23,10 +26,11 @@ namespace Volo.Abp.Identity
}
protected internal IdentityUserRole(Guid userId, Guid roleId)
protected internal IdentityUserRole(Guid userId, Guid roleId, Guid? tenantId)
{
UserId = userId;
RoleId = roleId;
TenantId = tenantId;
}
}
}

@ -1,14 +1,17 @@
using System;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Identity
{
/// <summary>
/// Represents an authentication token for a user.
/// </summary>
public class IdentityUserToken : Entity
public class IdentityUserToken : Entity, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
/// <summary>
/// Gets or sets the primary key of the user that the token belongs to.
/// </summary>
@ -34,7 +37,12 @@ namespace Volo.Abp.Identity
}
protected internal IdentityUserToken(Guid userId, [NotNull] string loginProvider, [NotNull] string name, string value)
protected internal IdentityUserToken(
Guid userId,
[NotNull] string loginProvider,
[NotNull] string name,
string value,
Guid? tenantId)
{
Check.NotNull(loginProvider, nameof(loginProvider));
Check.NotNull(name, nameof(name));
@ -43,6 +51,7 @@ namespace Volo.Abp.Identity
LoginProvider = loginProvider;
Name = name;
Value = value;
TenantId = tenantId;
}
}
}

@ -0,0 +1,265 @@
// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.Internal;
using System;
using Volo.Abp.Identity.EntityFrameworkCore;
namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations
{
[DbContext(typeof(IdentityDbContext))]
[Migration("20180218140410_Made_Identity_Entities_MultiTenant")]
partial class Made_Identity_Entities_MultiTenant
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.0.1-rtm-125")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.IsRequired()
.HasMaxLength(256);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("NormalizedName");
b.ToTable("IdentityRoles");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("ClaimValue")
.HasMaxLength(1024);
b.Property<Guid>("RoleId");
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("IdentityRoleClaims");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("AccessFailedCount")
.ValueGeneratedOnAdd()
.HasDefaultValue(0);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(256);
b.Property<string>("Email")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.ValueGeneratedOnAdd()
.HasDefaultValue(false);
b.Property<bool>("LockoutEnabled")
.ValueGeneratedOnAdd()
.HasDefaultValue(false);
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("PasswordHash")
.HasMaxLength(256);
b.Property<string>("PhoneNumber")
.HasMaxLength(16);
b.Property<bool>("PhoneNumberConfirmed")
.ValueGeneratedOnAdd()
.HasDefaultValue(false);
b.Property<string>("SecurityStamp")
.IsRequired()
.HasMaxLength(256);
b.Property<Guid?>("TenantId");
b.Property<bool>("TwoFactorEnabled")
.ValueGeneratedOnAdd()
.HasDefaultValue(false);
b.Property<string>("UserName")
.IsRequired()
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedEmail");
b.HasIndex("NormalizedUserName");
b.ToTable("IdentityUsers");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("ClaimValue")
.HasMaxLength(1024);
b.Property<Guid?>("TenantId");
b.Property<Guid>("UserId");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("IdentityUserClaims");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
{
b.Property<Guid>("UserId");
b.Property<string>("LoginProvider")
.HasMaxLength(64);
b.Property<string>("ProviderDisplayName")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(196);
b.Property<Guid?>("TenantId");
b.HasKey("UserId", "LoginProvider");
b.HasIndex("LoginProvider", "ProviderKey");
b.ToTable("IdentityUserLogins");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{
b.Property<Guid>("UserId");
b.Property<Guid>("RoleId");
b.Property<Guid?>("TenantId");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId", "UserId");
b.ToTable("IdentityUserRoles");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
{
b.Property<Guid>("UserId");
b.Property<string>("LoginProvider")
.HasMaxLength(128);
b.Property<string>("Name");
b.Property<Guid?>("TenantId");
b.Property<string>("Value");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("IdentityUserTokens");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole")
.WithMany("Claims")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser")
.WithMany("Claims")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser")
.WithMany("Logins")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.Identity.IdentityUser")
.WithMany("Roles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser")
.WithMany("Tokens")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}

@ -0,0 +1,78 @@
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;
namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations
{
public partial class Made_Identity_Entities_MultiTenant : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "TenantId",
table: "IdentityUserTokens",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "TenantId",
table: "IdentityUsers",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "TenantId",
table: "IdentityUserRoles",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "TenantId",
table: "IdentityUserLogins",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "TenantId",
table: "IdentityUserClaims",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "TenantId",
table: "IdentityRoles",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "TenantId",
table: "IdentityRoleClaims",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "TenantId",
table: "IdentityUserTokens");
migrationBuilder.DropColumn(
name: "TenantId",
table: "IdentityUsers");
migrationBuilder.DropColumn(
name: "TenantId",
table: "IdentityUserRoles");
migrationBuilder.DropColumn(
name: "TenantId",
table: "IdentityUserLogins");
migrationBuilder.DropColumn(
name: "TenantId",
table: "IdentityUserClaims");
migrationBuilder.DropColumn(
name: "TenantId",
table: "IdentityRoles");
migrationBuilder.DropColumn(
name: "TenantId",
table: "IdentityRoleClaims");
}
}
}

@ -17,7 +17,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452")
.HasAnnotation("ProductVersion", "2.0.1-rtm-125")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
@ -36,6 +36,8 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations
.IsRequired()
.HasMaxLength(256);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("NormalizedName");
@ -57,6 +59,8 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations
b.Property<Guid>("RoleId");
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("RoleId");
@ -112,6 +116,8 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations
.IsRequired()
.HasMaxLength(256);
b.Property<Guid?>("TenantId");
b.Property<bool>("TwoFactorEnabled")
.ValueGeneratedOnAdd()
.HasDefaultValue(false);
@ -141,6 +147,8 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations
b.Property<string>("ClaimValue")
.HasMaxLength(1024);
b.Property<Guid?>("TenantId");
b.Property<Guid>("UserId");
b.HasKey("Id");
@ -164,6 +172,8 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations
.IsRequired()
.HasMaxLength(196);
b.Property<Guid?>("TenantId");
b.HasKey("UserId", "LoginProvider");
b.HasIndex("LoginProvider", "ProviderKey");
@ -177,6 +187,8 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations
b.Property<Guid>("RoleId");
b.Property<Guid?>("TenantId");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId", "UserId");
@ -193,6 +205,8 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations
b.Property<string>("Name");
b.Property<Guid?>("TenantId");
b.Property<string>("Value");
b.HasKey("UserId", "LoginProvider", "Name");

@ -4,6 +4,9 @@ namespace Volo.Abp.MultiTenancy
{
public interface IMultiTenant
{
/// <summary>
/// Id of the related tenant.
/// </summary>
Guid? TenantId { get; }
}
}

@ -1,8 +1,6 @@
using System;
using System.Collections.ObjectModel;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.TestApp.Domain

Loading…
Cancel
Save