PersistedGrantStore should not set protected Entity.Id

pull/1810/head
Halil İbrahim Kalkan 5 years ago
parent 2dcb6c7b9d
commit 72847a3277

@ -2,6 +2,7 @@
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using IdentityServer4.Stores; using IdentityServer4.Stores;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Guids; using Volo.Abp.Guids;
using Volo.Abp.ObjectMapping; using Volo.Abp.ObjectMapping;
@ -26,7 +27,7 @@ namespace Volo.Abp.IdentityServer.Grants
if (entity == null) if (entity == null)
{ {
entity = _objectMapper.Map<IdentityServer4.Models.PersistedGrant, PersistedGrant>(grant); entity = _objectMapper.Map<IdentityServer4.Models.PersistedGrant, PersistedGrant>(grant);
entity.Id = _guidGenerator.Create(); EntityHelper.TrySetId(entity, () => _guidGenerator.Create());
await _persistentGrantRepository.InsertAsync(entity); await _persistentGrantRepository.InsertAsync(entity);
} }
else else

@ -140,7 +140,8 @@ namespace Volo.Abp.IdentityServer.Clients
{ {
Key = "#1P3R", Key = "#1P3R",
Type = "Type", Type = "Type",
ClientId = "ClientId" ClientId = "ClientId",
Data = ""
}); });
//Act //Act

Loading…
Cancel
Save