Browse Source

Added managers #16.

pull/81/head
Halil İbrahim Kalkan 10 years ago
parent
commit
60000cebf0
  1. 2
      src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRole.cs
  2. 27
      src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRoleManager.cs
  3. 2
      src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUser.cs
  4. 35
      src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityUserManager.cs
  5. 5
      src/Volo.Abp/Volo/Abp/Domain/Entities/AggregateRoot.cs
  6. 5
      src/Volo.Abp/Volo/Abp/Domain/Entities/IAggregateRoot.cs

2
src/Volo.Abp.Identity/Volo/Abp/Identity/IdentityRole.cs

@ -15,7 +15,7 @@ namespace Volo.Abp.Identity
/// <summary>
/// Represents a role in the identity system
/// </summary>
public class IdentityRole : Entity
public class IdentityRole : AggregateRoot
{
/// <summary>
/// Gets or sets the name for this role.

27
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<IdentityRole>
{
public IdentityRoleManager(
IRoleStore<IdentityRole> store,
IEnumerable<IRoleValidator<IdentityRole>> roleValidators,
ILookupNormalizer keyNormalizer,
IdentityErrorDescriber errors,
ILogger<IdentityRoleManager> logger,
IHttpContextAccessor contextAccessor)
: base(
store,
roleValidators,
keyNormalizer,
errors,
logger,
contextAccessor)
{
}
}
}

2
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
{
/// <summary>
/// Gets or sets the user name for this user.

35
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<IdentityUser>
{
public IdentityUserManager(
IUserStore<IdentityUser> store,
IOptions<IdentityOptions> optionsAccessor,
IPasswordHasher<IdentityUser> passwordHasher,
IEnumerable<IUserValidator<IdentityUser>> userValidators,
IEnumerable<IPasswordValidator<IdentityUser>> passwordValidators,
ILookupNormalizer keyNormalizer, IdentityErrorDescriber errors,
IServiceProvider services,
ILogger<IdentityUserManager> logger)
: base(
store,
optionsAccessor,
passwordHasher,
userValidators,
passwordValidators,
keyNormalizer,
errors,
services,
logger)
{
}
}
}

5
src/Volo.Abp/Volo/Abp/Domain/Entities/AggregateRoot.cs

@ -1,5 +1,10 @@
namespace Volo.Abp.Domain.Entities
{
public class AggregateRoot : AggregateRoot<string>, IAggregateRoot
{
}
public class AggregateRoot<TPrimaryKey> : Entity<TPrimaryKey>, IAggregateRoot<TPrimaryKey>
{

5
src/Volo.Abp/Volo/Abp/Domain/Entities/IAggregateRoot.cs

@ -2,6 +2,11 @@
{
//TODO: Domain events
public interface IAggregateRoot : IAggregateRoot<string>, IEntity
{
}
public interface IAggregateRoot<TPrimaryKey> : IEntity<TPrimaryKey>
{

Loading…
Cancel
Save