diff --git a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/BlogPostLister.cs b/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/BlogPostLister.cs index 0ee12943dd..a1d942f71a 100644 --- a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/BlogPostLister.cs +++ b/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/BlogPostLister.cs @@ -30,7 +30,7 @@ namespace AbpDesk.ConsoleDemo //blog.Comments.Add(new BlogPostComment("@john", "good post! " + DateTime.Now.ToString(CultureInfo.InvariantCulture), star: (byte)RandomHelper.GetRandom(1, 6))); //_blogPostRepository.Update(blog); - //_blogPostRepository.Insert(new BlogPost("Hello World 3!", DateTime.Now.ToString(CultureInfo.InvariantCulture))); + //_blogPostRepository.Insert(new BlogPost("Hello World 1!", DateTime.Now.ToString(CultureInfo.InvariantCulture))); foreach (var blogPost in _blogPostRepository) { diff --git a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/Program.cs b/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/Program.cs index 45555e2303..77941a273f 100644 --- a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/Program.cs +++ b/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/Program.cs @@ -26,12 +26,6 @@ namespace AbpDesk.ConsoleDemo Console.WriteLine("Press ENTER to run again..."); Console.ReadLine(); - RunDemo(application); - - Console.WriteLine(); - Console.WriteLine("Press ENTER to exit..."); - Console.ReadLine(); - application.Shutdown(); } } diff --git a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/BlogPost.cs b/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/BlogPost.cs index 1980503505..058dc3ccce 100644 --- a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/BlogPost.cs +++ b/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/BlogPost.cs @@ -22,7 +22,7 @@ namespace AbpDesk.Blogging public BlogPost([NotNull] string title, [NotNull] string body) { - Id = Guid.NewGuid().ToString("D"); + Id = Guid.NewGuid(); //TODO: Get from ctor! Check.NotNull(title, nameof(title)); Check.NotNull(body, nameof(body)); diff --git a/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs b/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs index 8cb88d38f0..06471c6ecc 100644 --- a/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs +++ b/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs @@ -9,9 +9,9 @@ using Volo.Abp.EntityFrameworkCore; namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore { - public class EfCoreRepository : EfCoreRepository, IEfCoreRepository + public class EfCoreRepository : EfCoreRepository, IEfCoreRepository where TDbContext : AbpDbContext - where TEntity : class, IEntity + where TEntity : class, IEntity { public EfCoreRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) diff --git a/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreRepository.cs b/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreRepository.cs index 38d083dac7..e7e6ab171f 100644 --- a/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreRepository.cs +++ b/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreRepository.cs @@ -1,10 +1,11 @@ +using System; using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Entities; namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore { - public interface IEfCoreRepository : IEfCoreRepository, IQueryableRepository - where TEntity : class, IEntity + public interface IEfCoreRepository : IEfCoreRepository, IQueryableRepository + where TEntity : class, IEntity { } diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20161221194225_AbpIdentity_Initial_Migration.Designer.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170119175536_Initial_Abp_Identity.Designer.cs similarity index 87% rename from src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20161221194225_AbpIdentity_Initial_Migration.Designer.cs rename to src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170119175536_Initial_Abp_Identity.Designer.cs index 9bf48b52ba..e54095b147 100644 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20161221194225_AbpIdentity_Initial_Migration.Designer.cs +++ b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170119175536_Initial_Abp_Identity.Designer.cs @@ -8,8 +8,8 @@ using Volo.Abp.Identity.EntityFrameworkCore; namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations { [DbContext(typeof(IdentityDbContext))] - [Migration("20161221194225_AbpIdentity_Initial_Migration")] - partial class AbpIdentity_Initial_Migration + [Migration("20170119175536_Initial_Abp_Identity")] + partial class Initial_Abp_Identity { protected override void BuildTargetModel(ModelBuilder modelBuilder) { @@ -19,7 +19,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd(); b.Property("ConcurrencyStamp") @@ -42,15 +42,14 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd(); b.Property("ClaimType"); b.Property("ClaimValue"); - b.Property("RoleId") - .IsRequired(); + b.Property("RoleId"); b.HasKey("Id"); @@ -61,7 +60,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd(); b.Property("AccessFailedCount"); @@ -111,15 +110,14 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd(); b.Property("ClaimType"); b.Property("ClaimValue"); - b.Property("UserId") - .IsRequired(); + b.Property("UserId"); b.HasKey("Id"); @@ -130,7 +128,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd(); b.Property("LoginProvider"); @@ -139,8 +137,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations b.Property("ProviderKey"); - b.Property("UserId") - .IsRequired(); + b.Property("UserId"); b.HasKey("Id"); @@ -152,14 +149,12 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd(); - b.Property("RoleId") - .IsRequired(); + b.Property("RoleId"); - b.Property("UserId") - .IsRequired(); + b.Property("UserId"); b.HasKey("Id"); @@ -173,15 +168,14 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd(); b.Property("LoginProvider"); b.Property("Name"); - b.Property("UserId") - .IsRequired(); + b.Property("UserId"); b.Property("Value"); diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20161221194225_AbpIdentity_Initial_Migration.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170119175536_Initial_Abp_Identity.cs similarity index 89% rename from src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20161221194225_AbpIdentity_Initial_Migration.cs rename to src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170119175536_Initial_Abp_Identity.cs index 95ecb64937..d52557901e 100644 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20161221194225_AbpIdentity_Initial_Migration.cs +++ b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170119175536_Initial_Abp_Identity.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations { - public partial class AbpIdentity_Initial_Migration : Migration + public partial class Initial_Abp_Identity : Migration { protected override void Up(MigrationBuilder migrationBuilder) { @@ -12,7 +12,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations name: "IdentityRoles", columns: table => new { - Id = table.Column(nullable: false), + Id = table.Column(nullable: false), ConcurrencyStamp = table.Column(nullable: true), Name = table.Column(maxLength: 256, nullable: true), NormalizedName = table.Column(maxLength: 256, nullable: true) @@ -26,20 +26,20 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations name: "IdentityUsers", columns: table => new { - Id = table.Column(nullable: false), - AccessFailedCount = table.Column(nullable: false, defaultValue: 0), + Id = table.Column(nullable: false), + AccessFailedCount = table.Column(nullable: false), ConcurrencyStamp = table.Column(nullable: true), Email = table.Column(maxLength: 256, nullable: true), - EmailConfirmed = table.Column(nullable: false, defaultValue: false), - LockoutEnabled = table.Column(nullable: false, defaultValue: false), + EmailConfirmed = table.Column(nullable: false), + LockoutEnabled = table.Column(nullable: false), LockoutEnd = table.Column(nullable: true), NormalizedEmail = table.Column(maxLength: 256, nullable: true), NormalizedUserName = table.Column(maxLength: 256, nullable: true), PasswordHash = table.Column(nullable: true), PhoneNumber = table.Column(nullable: true), - PhoneNumberConfirmed = table.Column(nullable: false, defaultValue: false), + PhoneNumberConfirmed = table.Column(nullable: false), SecurityStamp = table.Column(nullable: true), - TwoFactorEnabled = table.Column(nullable: false, defaultValue: false), + TwoFactorEnabled = table.Column(nullable: false), UserName = table.Column(maxLength: 256, nullable: true) }, constraints: table => @@ -51,10 +51,10 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations name: "IdentityRoleClaims", columns: table => new { - Id = table.Column(nullable: false), + Id = table.Column(nullable: false), ClaimType = table.Column(nullable: true), ClaimValue = table.Column(nullable: true), - RoleId = table.Column(nullable: false) + RoleId = table.Column(nullable: false) }, constraints: table => { @@ -71,10 +71,10 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations name: "IdentityUserClaims", columns: table => new { - Id = table.Column(nullable: false), + Id = table.Column(nullable: false), ClaimType = table.Column(nullable: true), ClaimValue = table.Column(nullable: true), - UserId = table.Column(nullable: false) + UserId = table.Column(nullable: false) }, constraints: table => { @@ -91,11 +91,11 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations name: "IdentityUserLogins", columns: table => new { - Id = table.Column(nullable: false), + Id = table.Column(nullable: false), LoginProvider = table.Column(nullable: true), ProviderDisplayName = table.Column(nullable: true), ProviderKey = table.Column(nullable: true), - UserId = table.Column(nullable: false) + UserId = table.Column(nullable: false) }, constraints: table => { @@ -112,9 +112,9 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations name: "IdentityUserRoles", columns: table => new { - Id = table.Column(nullable: false), - RoleId = table.Column(nullable: false), - UserId = table.Column(nullable: false) + Id = table.Column(nullable: false), + RoleId = table.Column(nullable: false), + UserId = table.Column(nullable: false) }, constraints: table => { @@ -137,10 +137,10 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations name: "IdentityUserTokens", columns: table => new { - Id = table.Column(nullable: false), + Id = table.Column(nullable: false), LoginProvider = table.Column(nullable: true), Name = table.Column(nullable: true), - UserId = table.Column(nullable: false), + UserId = table.Column(nullable: false), Value = table.Column(nullable: true) }, constraints: table => diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/IdentityDbContextModelSnapshot.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/IdentityDbContextModelSnapshot.cs index 5a86b97493..762d4a55c3 100644 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/IdentityDbContextModelSnapshot.cs +++ b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/IdentityDbContextModelSnapshot.cs @@ -18,7 +18,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd(); b.Property("ConcurrencyStamp") @@ -41,15 +41,14 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd(); b.Property("ClaimType"); b.Property("ClaimValue"); - b.Property("RoleId") - .IsRequired(); + b.Property("RoleId"); b.HasKey("Id"); @@ -60,7 +59,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd(); b.Property("AccessFailedCount"); @@ -110,15 +109,14 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd(); b.Property("ClaimType"); b.Property("ClaimValue"); - b.Property("UserId") - .IsRequired(); + b.Property("UserId"); b.HasKey("Id"); @@ -129,7 +127,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd(); b.Property("LoginProvider"); @@ -138,8 +136,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations b.Property("ProviderKey"); - b.Property("UserId") - .IsRequired(); + b.Property("UserId"); b.HasKey("Id"); @@ -151,14 +148,12 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd(); - b.Property("RoleId") - .IsRequired(); + b.Property("RoleId"); - b.Property("UserId") - .IsRequired(); + b.Property("UserId"); b.HasKey("Id"); @@ -172,15 +167,14 @@ namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd(); b.Property("LoginProvider"); b.Property("Name"); - b.Property("UserId") - .IsRequired(); + b.Property("UserId"); b.Property("Value"); diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EfCoreIdentityUserRepository.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EfCoreIdentityUserRepository.cs index 2fad6cd8c2..c458b87cac 100644 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EfCoreIdentityUserRepository.cs +++ b/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EfCoreIdentityUserRepository.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Threading; using System.Linq; using System.Security.Claims; @@ -22,7 +23,7 @@ namespace Volo.Abp.Identity return DbSet.FirstOrDefaultAsync(u => u.NormalizedUserName == normalizedUserName, cancellationToken); } - public Task> GetRoleNamesAsync(string userId) + public Task> GetRoleNamesAsync(Guid userId) { var query = from userRole in DbContext.UserRoles join role in DbContext.Roles on userRole.RoleId equals role.Id diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContext.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContext.cs index a5265a9ce1..df804cdde2 100644 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContext.cs +++ b/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContext.cs @@ -69,7 +69,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore { b.ToTable("IdentityUsers"); - b.Property(u => u.ConcurrencyStamp).IsConcurrencyToken(); + b.Property(u => u.ConcurrencyStamp).IsConcurrencyToken(); //TODO: Do automatically? b.Property(u => u.UserName).HasMaxLength(256); b.Property(u => u.NormalizedUserName).HasMaxLength(256); b.Property(u => u.Email).HasMaxLength(256); diff --git a/src/Volo.Abp.Identity/Volo/Abp/Identity/IIdentityUserRepository.cs b/src/Volo.Abp.Identity/Volo/Abp/Identity/IIdentityUserRepository.cs index 347b02c202..0342e800cf 100644 --- a/src/Volo.Abp.Identity/Volo/Abp/Identity/IIdentityUserRepository.cs +++ b/src/Volo.Abp.Identity/Volo/Abp/Identity/IIdentityUserRepository.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Security.Claims; using System.Threading; using System.Threading.Tasks; @@ -11,7 +12,7 @@ namespace Volo.Abp.Identity { Task FindByNormalizedUserNameAsync([NotNull] string normalizedUserName, CancellationToken cancellationToken); - Task> GetRoleNamesAsync([NotNull] string userId); + Task> GetRoleNamesAsync(Guid userId); Task FindByLoginAsync([NotNull] string loginProvider, [NotNull] string providerKey, CancellationToken cancellationToken); diff --git a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRoleClaim.cs b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRoleClaim.cs index d62d303535..e831db3642 100644 --- a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRoleClaim.cs +++ b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRoleClaim.cs @@ -1,3 +1,4 @@ +using System; using System.Security.Claims; using JetBrains.Annotations; using Volo.Abp.Domain.Entities; @@ -12,7 +13,7 @@ namespace Volo.Abp.Identity /// /// Gets or sets the of the primary key of the role associated with this claim. /// - public virtual string RoleId { get; protected set; } + public virtual Guid RoleId { get; protected set; } /// /// Gets or sets the claim type for this claim. @@ -29,9 +30,8 @@ namespace Volo.Abp.Identity } - public IdentityRoleClaim([NotNull] string roleId, [NotNull] Claim claim) + public IdentityRoleClaim(Guid roleId, [NotNull] Claim claim) { - Check.NotNull(roleId, nameof(roleId)); Check.NotNull(claim, nameof(claim)); RoleId = roleId; @@ -39,7 +39,7 @@ namespace Volo.Abp.Identity ClaimValue = claim.Value; } - public IdentityRoleClaim([NotNull] string roleId, [NotNull] string claimType, string claimValue) + public IdentityRoleClaim(Guid roleId, [NotNull] string claimType, string claimValue) { Check.NotNull(roleId, nameof(roleId)); Check.NotNull(claimType, nameof(claimType)); diff --git a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUser.cs b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUser.cs index e22ab4829c..b5970093af 100644 --- a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUser.cs +++ b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUser.cs @@ -128,7 +128,7 @@ namespace Volo.Abp.Identity UserName = userName; } - public void AddRole([NotNull] string roleId) + public void AddRole([NotNull] Guid roleId) { Check.NotNull(roleId, nameof(roleId)); @@ -140,7 +140,7 @@ namespace Volo.Abp.Identity Roles.Add(new IdentityUserRole(Id, roleId)); } - public void RemoveRole([NotNull] string roleId) + public void RemoveRole(Guid roleId) { Check.NotNull(roleId, nameof(roleId)); @@ -152,7 +152,7 @@ namespace Volo.Abp.Identity Roles.Add(new IdentityUserRole(Id, roleId)); } - public bool IsInRole([NotNull] string roleId) + public bool IsInRole(Guid roleId) { Check.NotNull(roleId, nameof(roleId)); diff --git a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserClaim.cs b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserClaim.cs index 9eb97a4eeb..6dd7a56020 100644 --- a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserClaim.cs +++ b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserClaim.cs @@ -1,3 +1,4 @@ +using System; using System.Security.Claims; using JetBrains.Annotations; using Volo.Abp.Domain.Entities; @@ -12,7 +13,7 @@ namespace Volo.Abp.Identity /// /// Gets or sets the primary key of the user associated with this claim. /// - public virtual string UserId { get; protected set; } + public virtual Guid UserId { get; protected set; } /// /// Gets or sets the claim type for this claim. @@ -29,9 +30,8 @@ namespace Volo.Abp.Identity } - public IdentityUserClaim([NotNull] string userId, [NotNull] Claim claim) + public IdentityUserClaim(Guid userId, [NotNull] Claim claim) { - Check.NotNull(userId, nameof(userId)); Check.NotNull(claim, nameof(claim)); UserId = userId; @@ -39,9 +39,8 @@ namespace Volo.Abp.Identity ClaimValue = claim.Value; } - public IdentityUserClaim([NotNull] string userId, [NotNull] string claimType, string claimValue) + public IdentityUserClaim(Guid userId, [NotNull] string claimType, string claimValue) { - Check.NotNull(userId, nameof(userId)); Check.NotNull(claimType, nameof(claimType)); UserId = userId; diff --git a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserLogin.cs b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserLogin.cs index defec8c4cc..eb32b92c9b 100644 --- a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserLogin.cs +++ b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserLogin.cs @@ -1,3 +1,4 @@ +using System; using JetBrains.Annotations; using Microsoft.AspNetCore.Identity; using Volo.Abp.Domain.Entities; @@ -14,7 +15,7 @@ namespace Volo.Abp.Identity /// /// Gets or sets the of the primary key of the user associated with this login. /// - public virtual string UserId { get; protected set; } + public virtual Guid UserId { get; protected set; } /// /// Gets or sets the login provider for the login (e.g. facebook, google) @@ -36,9 +37,8 @@ namespace Volo.Abp.Identity } - public IdentityUserLogin([NotNull] string userId, [NotNull] string loginProvider, [NotNull] string providerKey, string providerDisplayName) + public IdentityUserLogin(Guid userId, [NotNull] string loginProvider, [NotNull] string providerKey, string providerDisplayName) { - Check.NotNull(userId, nameof(userId)); Check.NotNull(loginProvider, nameof(loginProvider)); Check.NotNull(providerKey, nameof(providerKey)); @@ -48,9 +48,8 @@ namespace Volo.Abp.Identity ProviderDisplayName = providerDisplayName; } - public IdentityUserLogin(string userId, UserLoginInfo login) + public IdentityUserLogin(Guid userId, UserLoginInfo login) { - Check.NotNull(userId, nameof(userId)); Check.NotNull(login, nameof(login)); UserId = userId; diff --git a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserRole.cs b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserRole.cs index 8b332e82a4..8f8a591bc1 100644 --- a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserRole.cs +++ b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserRole.cs @@ -1,4 +1,4 @@ -using JetBrains.Annotations; +using System; using Volo.Abp.Domain.Entities; namespace Volo.Abp.Identity @@ -11,23 +11,20 @@ namespace Volo.Abp.Identity /// /// Gets or sets the primary key of the user that is linked to a role. /// - public virtual string UserId { get; protected set; } + public virtual Guid UserId { get; protected set; } /// /// Gets or sets the primary key of the role that is linked to the user. /// - public virtual string RoleId { get; protected set; } + public virtual Guid RoleId { get; protected set; } protected IdentityUserRole() { } - public IdentityUserRole([NotNull] string userId, [NotNull] string roleId) + public IdentityUserRole(Guid userId, Guid roleId) { - Check.NotNull(userId, nameof(userId)); - Check.NotNull(roleId, nameof(roleId)); - UserId = userId; RoleId = roleId; } diff --git a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserToken.cs b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserToken.cs index 4da14a23d6..fd750d851b 100644 --- a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserToken.cs +++ b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserToken.cs @@ -1,3 +1,4 @@ +using System; using JetBrains.Annotations; using Volo.Abp.Domain.Entities; @@ -11,7 +12,7 @@ namespace Volo.Abp.Identity /// /// Gets or sets the primary key of the user that the token belongs to. /// - public virtual string UserId { get; protected set; } + public virtual Guid UserId { get; protected set; } /// /// Gets or sets the LoginProvider this token is from. @@ -33,7 +34,7 @@ namespace Volo.Abp.Identity } - public IdentityUserToken([NotNull] string userId, [NotNull] string loginProvider, [NotNull] string name, string value) //TODO: Can value be null? + public IdentityUserToken(Guid userId, [NotNull] string loginProvider, [NotNull] string name, string value) //TODO: Can value be null? { Check.NotNull(userId, nameof(userId)); Check.NotNull(loginProvider, nameof(loginProvider)); diff --git a/src/Volo.Abp.Identity/Volo/Abp/Identity/RoleStore.cs b/src/Volo.Abp.Identity/Volo/Abp/Identity/RoleStore.cs index e1606b53b1..05b6ec5261 100644 --- a/src/Volo.Abp.Identity/Volo/Abp/Identity/RoleStore.cs +++ b/src/Volo.Abp.Identity/Volo/Abp/Identity/RoleStore.cs @@ -77,7 +77,7 @@ namespace Volo.Abp.Identity Check.NotNull(role, nameof(role)); - await _roleRepository.InsertAsync(role); + await _roleRepository.InsertAsync(role, cancellationToken: cancellationToken); await SaveChanges(cancellationToken); return IdentityResult.Success; @@ -96,7 +96,7 @@ namespace Volo.Abp.Identity Check.NotNull(role, nameof(role)); - await _roleRepository.UpdateAsync(role); + await _roleRepository.UpdateAsync(role, cancellationToken); try { @@ -126,7 +126,7 @@ namespace Volo.Abp.Identity try { - await _roleRepository.DeleteAsync(role); + await _roleRepository.DeleteAsync(role, cancellationToken); await SaveChanges(cancellationToken); } catch (AbpDbConcurrencyException ex) @@ -151,7 +151,7 @@ namespace Volo.Abp.Identity Check.NotNull(role, nameof(role)); - return Task.FromResult(role.Id); + return Task.FromResult(role.Id.ToString()); } /// @@ -194,15 +194,12 @@ namespace Volo.Abp.Identity /// The role ID to look for. /// The used to propagate notifications that the operation should be canceled. /// A that result of the look up. - public virtual Task FindByIdAsync([NotNull] string id, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task FindByIdAsync(string id, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); - Check.NotNull(id, nameof(id)); - - //TODO: Add cancellationToken to Repository.FindAsync method as overload - return _roleRepository.FindAsync(id); + return _roleRepository.FindAsync(Guid.Parse(id), cancellationToken); } /// diff --git a/src/Volo.Abp.Identity/Volo/Abp/Identity/UserStore.cs b/src/Volo.Abp.Identity/Volo/Abp/Identity/UserStore.cs index e69da199d4..b798ca7af5 100644 --- a/src/Volo.Abp.Identity/Volo/Abp/Identity/UserStore.cs +++ b/src/Volo.Abp.Identity/Volo/Abp/Identity/UserStore.cs @@ -87,7 +87,7 @@ namespace Volo.Abp.Identity Check.NotNull(user, nameof(user)); - return Task.FromResult(user.Id); + return Task.FromResult(user.Id.ToString()); } /// @@ -241,15 +241,12 @@ namespace Volo.Abp.Identity /// /// The that represents the asynchronous operation, containing the user matching the specified if it exists. /// - public virtual Task FindByIdAsync([NotNull] string userId, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); - Check.NotNull(userId, nameof(userId)); - - //TODO: Add cancellationToken to Repository.FindAsync method as overload - return _userRepository.FindAsync(userId); + return _userRepository.FindAsync(Guid.Parse(userId), cancellationToken); } /// diff --git a/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepository.cs b/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepository.cs index 8b427ad263..82ffb23f6b 100644 --- a/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepository.cs +++ b/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepository.cs @@ -1,10 +1,11 @@ -using MongoDB.Driver; +using System; +using MongoDB.Driver; using Volo.Abp.Domain.Entities; namespace Volo.Abp.Domain.Repositories.MongoDB { - public interface IMongoDbRepository : IMongoDbRepository, IQueryableRepository - where TEntity : class, IEntity + public interface IMongoDbRepository : IMongoDbRepository, IQueryableRepository + where TEntity : class, IEntity { } diff --git a/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs b/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs index 73e42bffce..6c183ca5a7 100644 --- a/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs +++ b/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs @@ -1,3 +1,4 @@ +using System; using System.Linq; using MongoDB.Driver; using Volo.Abp.Domain.Entities; @@ -5,9 +6,9 @@ using Volo.Abp.MongoDB; namespace Volo.Abp.Domain.Repositories.MongoDB { - public class MongoDbRepository : MongoDbRepository, IMongoDbRepository + public class MongoDbRepository : MongoDbRepository, IMongoDbRepository where TMongoDbContext : AbpMongoDbContext - where TEntity : class, IEntity + where TEntity : class, IEntity { public MongoDbRepository(IMongoDatabaseProvider databaseProvider) : base(databaseProvider) diff --git a/src/Volo.Abp/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs b/src/Volo.Abp/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs index 9b4c5a1e15..12b0a3dbba 100644 --- a/src/Volo.Abp/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs +++ b/src/Volo.Abp/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs @@ -62,7 +62,7 @@ namespace Microsoft.Extensions.DependencyInjection private static bool BothSupportsDefaultPrimaryKey(Type entityType, Type repositoryImplementationType) { - return typeof(IEntity).GetTypeInfo().IsAssignableFrom(entityType) && + return typeof(IEntity).GetTypeInfo().IsAssignableFrom(entityType) && ReflectionHelper.IsAssignableToGenericType(repositoryImplementationType, typeof(IRepository<>)); } } diff --git a/src/Volo.Abp/Volo/Abp/Domain/Entities/AggregateRoot.cs b/src/Volo.Abp/Volo/Abp/Domain/Entities/AggregateRoot.cs index 30660acbba..1b432ca950 100644 --- a/src/Volo.Abp/Volo/Abp/Domain/Entities/AggregateRoot.cs +++ b/src/Volo.Abp/Volo/Abp/Domain/Entities/AggregateRoot.cs @@ -1,6 +1,8 @@ -namespace Volo.Abp.Domain.Entities +using System; + +namespace Volo.Abp.Domain.Entities { - public class AggregateRoot : AggregateRoot, IAggregateRoot + public class AggregateRoot : AggregateRoot, IAggregateRoot { } diff --git a/src/Volo.Abp/Volo/Abp/Domain/Entities/DefaultIdGenerator.cs b/src/Volo.Abp/Volo/Abp/Domain/Entities/DefaultIdGenerator.cs index bb075812c1..6c91ca72fc 100644 --- a/src/Volo.Abp/Volo/Abp/Domain/Entities/DefaultIdGenerator.cs +++ b/src/Volo.Abp/Volo/Abp/Domain/Entities/DefaultIdGenerator.cs @@ -4,6 +4,7 @@ using Volo.DependencyInjection; namespace Volo.Abp.Domain.Entities { + //TODO: No need! Directly use Guid Generator! public class DefaultIdGenerator : IIdGenerator, ITransientDependency { private readonly IGuidGenerator _guidGenerator; @@ -15,7 +16,7 @@ namespace Volo.Abp.Domain.Entities public string GenerateStringId() { - return GenerateGuid().ToString("D"); + return GenerateGuid().ToString(); } public Guid GenerateGuid() diff --git a/src/Volo.Abp/Volo/Abp/Domain/Entities/Entity.cs b/src/Volo.Abp/Volo/Abp/Domain/Entities/Entity.cs index 15c0971e46..302e673c11 100644 --- a/src/Volo.Abp/Volo/Abp/Domain/Entities/Entity.cs +++ b/src/Volo.Abp/Volo/Abp/Domain/Entities/Entity.cs @@ -7,7 +7,7 @@ namespace Volo.Abp.Domain.Entities /// /// A shortcut of for default primary key type (). /// - public abstract class Entity : Entity, IEntity + public abstract class Entity : Entity, IEntity { } diff --git a/src/Volo.Abp/Volo/Abp/Domain/Entities/IAggregateRoot.cs b/src/Volo.Abp/Volo/Abp/Domain/Entities/IAggregateRoot.cs index 621004c93e..9ef287eb68 100644 --- a/src/Volo.Abp/Volo/Abp/Domain/Entities/IAggregateRoot.cs +++ b/src/Volo.Abp/Volo/Abp/Domain/Entities/IAggregateRoot.cs @@ -1,6 +1,8 @@ -namespace Volo.Abp.Domain.Entities +using System; + +namespace Volo.Abp.Domain.Entities { - public interface IAggregateRoot : IAggregateRoot, IEntity + public interface IAggregateRoot : IAggregateRoot, IEntity { } diff --git a/src/Volo.Abp/Volo/Abp/Domain/Entities/IEntity.cs b/src/Volo.Abp/Volo/Abp/Domain/Entities/IEntity.cs index fd5f75287e..2d48ee20e7 100644 --- a/src/Volo.Abp/Volo/Abp/Domain/Entities/IEntity.cs +++ b/src/Volo.Abp/Volo/Abp/Domain/Entities/IEntity.cs @@ -1,9 +1,11 @@ -namespace Volo.Abp.Domain.Entities +using System; + +namespace Volo.Abp.Domain.Entities { /// /// A shortcut of for default primary key type (). /// - public interface IEntity : IEntity + public interface IEntity : IEntity { } diff --git a/src/Volo.Abp/Volo/Abp/Domain/Repositories/IQueryableRepository.cs b/src/Volo.Abp/Volo/Abp/Domain/Repositories/IQueryableRepository.cs index ad0a56f8c6..48217e2773 100644 --- a/src/Volo.Abp/Volo/Abp/Domain/Repositories/IQueryableRepository.cs +++ b/src/Volo.Abp/Volo/Abp/Domain/Repositories/IQueryableRepository.cs @@ -8,8 +8,8 @@ using Volo.Abp.Domain.Entities; namespace Volo.Abp.Domain.Repositories { - public interface IQueryableRepository : IQueryableRepository, IRepository - where TEntity : class, IEntity + public interface IQueryableRepository : IQueryableRepository, IRepository + where TEntity : class, IEntity { } diff --git a/src/Volo.Abp/Volo/Abp/Domain/Repositories/IRepository.cs b/src/Volo.Abp/Volo/Abp/Domain/Repositories/IRepository.cs index 8dbfa715b2..c086c3223d 100644 --- a/src/Volo.Abp/Volo/Abp/Domain/Repositories/IRepository.cs +++ b/src/Volo.Abp/Volo/Abp/Domain/Repositories/IRepository.cs @@ -1,4 +1,5 @@ -using System.Threading; +using System; +using System.Threading; using System.Threading.Tasks; using JetBrains.Annotations; using Volo.Abp.Domain.Entities; @@ -11,8 +12,8 @@ namespace Volo.Abp.Domain.Repositories } - public interface IRepository : IRepository - where TEntity : class, IEntity + public interface IRepository : IRepository + where TEntity : class, IEntity { } @@ -66,6 +67,7 @@ namespace Volo.Abp.Domain.Repositories [NotNull] TEntity Insert([NotNull] TEntity entity, bool autoSave = false); + //TODO: Consider to add a new overload that takes cancellationToken as second argument? /// /// Inserts a new entity. /// @@ -76,7 +78,7 @@ namespace Volo.Abp.Domain.Repositories /// A to observe while waiting for the task to complete. /// Inserted entity [NotNull] - Task InsertAsync([NotNull] TEntity entity, bool autoSave = true, CancellationToken cancellationToken = default(CancellationToken)); + Task InsertAsync([NotNull] TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates an existing entity. diff --git a/src/Volo.Abp/Volo/Abp/Domain/Repositories/QueryableRepositoryBase.cs b/src/Volo.Abp/Volo/Abp/Domain/Repositories/QueryableRepositoryBase.cs index 1833e87418..7e9866179f 100644 --- a/src/Volo.Abp/Volo/Abp/Domain/Repositories/QueryableRepositoryBase.cs +++ b/src/Volo.Abp/Volo/Abp/Domain/Repositories/QueryableRepositoryBase.cs @@ -9,8 +9,8 @@ using Volo.Abp.Domain.Entities; namespace Volo.Abp.Domain.Repositories { - public abstract class QueryableRepositoryBase : QueryableRepositoryBase, IQueryableRepository - where TEntity : class, IEntity + public abstract class QueryableRepositoryBase : QueryableRepositoryBase, IQueryableRepository + where TEntity : class, IEntity { } diff --git a/src/Volo.Abp/Volo/Abp/Domain/Repositories/RepositoryBase.cs b/src/Volo.Abp/Volo/Abp/Domain/Repositories/RepositoryBase.cs index 290d74f60b..b80d7d14b9 100644 --- a/src/Volo.Abp/Volo/Abp/Domain/Repositories/RepositoryBase.cs +++ b/src/Volo.Abp/Volo/Abp/Domain/Repositories/RepositoryBase.cs @@ -6,8 +6,8 @@ using Volo.Abp.Domain.Entities; namespace Volo.Abp.Domain.Repositories { - public abstract class RepositoryBase : RepositoryBase, IRepository - where TEntity : class, IEntity + public abstract class RepositoryBase : RepositoryBase, IRepository + where TEntity : class, IEntity { } diff --git a/src/Volo.Abp/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs b/src/Volo.Abp/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs index 6426f892bb..e769e36f3c 100644 --- a/src/Volo.Abp/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs +++ b/src/Volo.Abp/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs @@ -45,7 +45,7 @@ namespace Volo.Abp.Domain.Repositories protected void RegisterDefaultRepository(IServiceCollection services, Type dbContextType, Type entityType) { var primaryKeyType = EntityHelper.GetPrimaryKeyType(entityType); - var isDefaultPrimaryKey = primaryKeyType == typeof(string); + var isDefaultPrimaryKey = primaryKeyType == typeof(Guid); Type repositoryImplementationType; if (Options.SpecifiedDefaultRepositoryTypes) diff --git a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/Initialize_Tests.cs b/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/Initialize_Tests.cs index e7f3b28ead..ac8b510eaa 100644 --- a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/Initialize_Tests.cs +++ b/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/Initialize_Tests.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; +using System; +using Microsoft.Extensions.DependencyInjection; using Shouldly; using Volo.Abp.Domain.Repositories; using Volo.Abp.TestBase; @@ -26,10 +27,10 @@ namespace Volo.Abp.Identity { (ServiceProvider.GetRequiredService() is EfCoreIdentityUserRepository).ShouldBeTrue(); - (ServiceProvider.GetRequiredService>() is EfCoreIdentityUserRepository).ShouldBeTrue(); + (ServiceProvider.GetRequiredService>() is EfCoreIdentityUserRepository).ShouldBeTrue(); (ServiceProvider.GetRequiredService>() is EfCoreIdentityUserRepository).ShouldBeTrue(); - (ServiceProvider.GetRequiredService>() is EfCoreIdentityUserRepository).ShouldBeTrue(); + (ServiceProvider.GetRequiredService>() is EfCoreIdentityUserRepository).ShouldBeTrue(); (ServiceProvider.GetRequiredService>() is EfCoreIdentityUserRepository).ShouldBeTrue(); } } diff --git a/test/Volo.Abp.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs b/test/Volo.Abp.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs index 1dfa092649..59c444eed7 100644 --- a/test/Volo.Abp.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs +++ b/test/Volo.Abp.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs @@ -26,7 +26,7 @@ namespace Volo.Abp.Domain.Repositories //Assert services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); + services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); services.ShouldNotContainService(typeof(IRepository)); } @@ -47,7 +47,7 @@ namespace Volo.Abp.Domain.Repositories //Assert services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); + services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); } @@ -70,7 +70,7 @@ namespace Volo.Abp.Domain.Repositories //Assert services.ShouldContainTransient(typeof(IRepository), typeof(MyTestAggregateRootWithDefaultPkCustomRepository)); - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestAggregateRootWithDefaultPkCustomRepository)); + services.ShouldContainTransient(typeof(IRepository), typeof(MyTestAggregateRootWithDefaultPkCustomRepository)); services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); } @@ -93,7 +93,7 @@ namespace Volo.Abp.Domain.Repositories //Assert services.ShouldContainTransient(typeof(IRepository), typeof(MyTestCustomBaseRepository)); - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestCustomBaseRepository)); + services.ShouldContainTransient(typeof(IRepository), typeof(MyTestCustomBaseRepository)); services.ShouldContainTransient(typeof(IRepository), typeof(MyTestCustomBaseRepository)); } @@ -136,8 +136,8 @@ namespace Volo.Abp.Domain.Repositories } - public class MyTestDefaultRepository : MyTestDefaultRepository, IRepository - where TEntity : class, IEntity + public class MyTestDefaultRepository : MyTestDefaultRepository, IRepository + where TEntity : class, IEntity { } @@ -171,8 +171,8 @@ namespace Volo.Abp.Domain.Repositories } - public class MyTestCustomBaseRepository : MyTestCustomBaseRepository, IRepository - where TEntity : class, IEntity + public class MyTestCustomBaseRepository : MyTestCustomBaseRepository, IRepository + where TEntity : class, IEntity { }