Browse Source

Added todo and renamed MemoryDatabase._idGenerators

pull/272/head
Halil İbrahim Kalkan 9 years ago
parent
commit
be3afe8dd2
  1. 1
      src/Volo.Abp.Identity.Web/Navigation/AbpIdentityWebMainMenuContributor.cs
  2. 6
      src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDatabase.cs

1
src/Volo.Abp.Identity.Web/Navigation/AbpIdentityWebMainMenuContributor.cs

@ -16,6 +16,7 @@ namespace Volo.Abp.Identity.Web.Navigation
var permissionChecker = context.ServiceProvider.GetRequiredService<IPermissionChecker>(); var permissionChecker = context.ServiceProvider.GetRequiredService<IPermissionChecker>();
//TODO: We should not add this if none of the children available. Alternatively, we can handle it on menu rendering (would be simpler).
var identityMenuItem = new ApplicationMenuItem("Identity", "Identity"); var identityMenuItem = new ApplicationMenuItem("Identity", "Identity");
context.Menu.AddItem(identityMenuItem); context.Menu.AddItem(identityMenuItem);

6
src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDatabase.cs

@ -8,12 +8,12 @@ namespace Volo.Abp.Domain.Repositories.MemoryDb
{ {
private readonly ConcurrentDictionary<Type, object> _sets; private readonly ConcurrentDictionary<Type, object> _sets;
private readonly ConcurrentDictionary<Type, InMemoryIdGenerator> _idGenerators; private readonly ConcurrentDictionary<Type, InMemoryIdGenerator> _entityIdGenerators;
public MemoryDatabase() public MemoryDatabase()
{ {
_sets = new ConcurrentDictionary<Type, object>(); _sets = new ConcurrentDictionary<Type, object>();
_idGenerators = new ConcurrentDictionary<Type, InMemoryIdGenerator>(); _entityIdGenerators = new ConcurrentDictionary<Type, InMemoryIdGenerator>();
} }
public List<TEntity> Collection<TEntity>() public List<TEntity> Collection<TEntity>()
@ -23,7 +23,7 @@ namespace Volo.Abp.Domain.Repositories.MemoryDb
public TKey GenerateNextId<TEntity, TKey>() public TKey GenerateNextId<TEntity, TKey>()
{ {
return _idGenerators return _entityIdGenerators
.GetOrAdd(typeof(TEntity), () => new InMemoryIdGenerator()) .GetOrAdd(typeof(TEntity), () => new InMemoryIdGenerator())
.GenerateNext<TKey>(); .GenerateNext<TKey>();
} }

Loading…
Cancel
Save