From 60000cebf03fce690ae4c09ae9eb8e8abe2b4c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Wed, 21 Dec 2016 21:13:24 +0300 Subject: [PATCH] Added managers #16. --- .../Volo/Abp/Identity/IdentityRole.cs | 2 +- .../Volo/Abp/Identity/IdentityRoleManager.cs | 27 ++++++++++++++ .../Volo/Abp/Identity/IdentityUser.cs | 2 +- .../Volo/Abp/Identity/IdentityUserManager.cs | 35 +++++++++++++++++++ .../Volo/Abp/Domain/Entities/AggregateRoot.cs | 5 +++ .../Abp/Domain/Entities/IAggregateRoot.cs | 5 +++ 6 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRoleManager.cs create mode 100644 src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserManager.cs diff --git a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRole.cs b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRole.cs index f9da7f8f56..4f7ed611ff 100644 --- a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRole.cs +++ b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRole.cs @@ -15,7 +15,7 @@ namespace Volo.Abp.Identity /// /// Represents a role in the identity system /// - public class IdentityRole : Entity + public class IdentityRole : AggregateRoot { /// /// Gets or sets the name for this role. diff --git a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRoleManager.cs b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRoleManager.cs new file mode 100644 index 0000000000..25ba5dc270 --- /dev/null +++ b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRoleManager.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Identity; +using Microsoft.Extensions.Logging; + +namespace Volo.Abp.Identity +{ + public class IdentityRoleManager : RoleManager + { + public IdentityRoleManager( + IRoleStore store, + IEnumerable> roleValidators, + ILookupNormalizer keyNormalizer, + IdentityErrorDescriber errors, + ILogger logger, + IHttpContextAccessor contextAccessor) + : base( + store, + roleValidators, + keyNormalizer, + errors, + logger, + contextAccessor) + { + } + } +} diff --git a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUser.cs b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUser.cs index b803419ccd..8d8930f80c 100644 --- a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUser.cs +++ b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUser.cs @@ -9,7 +9,7 @@ namespace Volo.Abp.Identity //TODO: Should set Id to a GUID (where? on repository?) //TODO: Properties should not be public! - public class IdentityUser : Entity + public class IdentityUser : AggregateRoot { /// /// Gets or sets the user name for this user. diff --git a/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserManager.cs b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserManager.cs new file mode 100644 index 0000000000..b0d40a8fd1 --- /dev/null +++ b/src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserManager.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Identity; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace Volo.Abp.Identity +{ + public class IdentityUserManager : UserManager + { + public IdentityUserManager( + IUserStore store, + IOptions optionsAccessor, + IPasswordHasher passwordHasher, + IEnumerable> userValidators, + IEnumerable> passwordValidators, + ILookupNormalizer keyNormalizer, IdentityErrorDescriber errors, + IServiceProvider services, + ILogger logger) + : base( + store, + optionsAccessor, + passwordHasher, + userValidators, + passwordValidators, + keyNormalizer, + errors, + services, + logger) + { + + } + } +} diff --git a/src/Volo.Abp/Volo/Abp/Domain/Entities/AggregateRoot.cs b/src/Volo.Abp/Volo/Abp/Domain/Entities/AggregateRoot.cs index 24b9a5c6f5..30660acbba 100644 --- a/src/Volo.Abp/Volo/Abp/Domain/Entities/AggregateRoot.cs +++ b/src/Volo.Abp/Volo/Abp/Domain/Entities/AggregateRoot.cs @@ -1,5 +1,10 @@ namespace Volo.Abp.Domain.Entities { + public class AggregateRoot : AggregateRoot, IAggregateRoot + { + + } + public class AggregateRoot : Entity, IAggregateRoot { diff --git a/src/Volo.Abp/Volo/Abp/Domain/Entities/IAggregateRoot.cs b/src/Volo.Abp/Volo/Abp/Domain/Entities/IAggregateRoot.cs index 3c0c97ba99..c00f15de09 100644 --- a/src/Volo.Abp/Volo/Abp/Domain/Entities/IAggregateRoot.cs +++ b/src/Volo.Abp/Volo/Abp/Domain/Entities/IAggregateRoot.cs @@ -2,6 +2,11 @@ { //TODO: Domain events + public interface IAggregateRoot : IAggregateRoot, IEntity + { + + } + public interface IAggregateRoot : IEntity {