ClientRepository changes Yunus Emre Kalkan committed

pull/570/head
Yunus Emre Kalkan 7 years ago
parent 162b4112e6
commit 14b0d47420

@ -193,9 +193,19 @@ namespace Volo.Abp.IdentityServer.Clients
IdentityProviderRestrictions.Add(new ClientIdPRestriction(Id, provider));
}
public virtual void AddProperty([NotNull] string key)
public virtual void RemoveAllIdentityProviderRestriction()
{
Properties.Add(new ClientProperty(Id, key));
IdentityProviderRestrictions.Clear();
}
public virtual void AddProperty([NotNull] string key, [NotNull] string value)
{
Properties.Add(new ClientProperty(Id, key,value));
}
public virtual void RemoveAllProperties()
{
Properties.Clear();
}
public virtual void AddClaim(IGuidGenerator guidGenerator, [NotNull] string type, string value)

@ -17,12 +17,13 @@ namespace Volo.Abp.IdentityServer.Clients
}
protected internal ClientProperty(Guid clientId, [NotNull] string key)
protected internal ClientProperty(Guid clientId, [NotNull] string key, [NotNull] string value)
{
Check.NotNull(key, nameof(key));
ClientId = clientId;
Key = key;
Value = value;
}
public override object[] GetKeys()

@ -66,6 +66,20 @@ namespace Volo.Abp.IdentityServer.Clients
DbContext.Set<ClientGrantType>().Remove(grantType);
}
var restrictions = DbContext.Set<ClientIdPRestriction>().Where(s => s.ClientId == entity.Id);
foreach (var restriction in restrictions)
{
DbContext.Set<ClientIdPRestriction>().Remove(restriction);
}
var properties = DbContext.Set<ClientProperty>().Where(s => s.ClientId == entity.Id);
foreach (var clientProperty in properties)
{
DbContext.Set<ClientProperty>().Remove(clientProperty);
}
return await base.UpdateAsync(entity, autoSave, cancellationToken);
}

Loading…
Cancel
Save