|
|
|
@ -6,7 +6,7 @@ public static class OpenIddictApplicationExtensions |
|
|
|
{ |
|
|
|
Check.NotNull(model, nameof(model)); |
|
|
|
|
|
|
|
return new OpenIddictApplication(model.Id) |
|
|
|
var entity = new OpenIddictApplication(model.Id) |
|
|
|
{ |
|
|
|
ClientId = model.ClientId, |
|
|
|
ClientSecret = model.ClientSecret, |
|
|
|
@ -20,6 +20,13 @@ public static class OpenIddictApplicationExtensions |
|
|
|
Requirements = model.Requirements, |
|
|
|
Type = model.Type |
|
|
|
}; |
|
|
|
|
|
|
|
foreach (var extraProperty in model.ExtraProperties) |
|
|
|
{ |
|
|
|
entity.ExtraProperties.Add(extraProperty.Key, extraProperty.Value); |
|
|
|
} |
|
|
|
|
|
|
|
return entity; |
|
|
|
} |
|
|
|
|
|
|
|
public static OpenIddictApplication ToEntity(this OpenIddictApplicationModel model, OpenIddictApplication entity) |
|
|
|
@ -39,30 +46,43 @@ public static class OpenIddictApplicationExtensions |
|
|
|
entity.Requirements = model.Requirements; |
|
|
|
entity.Type = model.Type; |
|
|
|
|
|
|
|
foreach (var extraProperty in model.ExtraProperties) |
|
|
|
{ |
|
|
|
entity.ExtraProperties.Remove(extraProperty.Key); |
|
|
|
entity.ExtraProperties.Add(extraProperty.Key, extraProperty.Value); |
|
|
|
} |
|
|
|
|
|
|
|
return entity; |
|
|
|
} |
|
|
|
|
|
|
|
public static OpenIddictApplicationModel ToModel(this OpenIddictApplication model) |
|
|
|
public static OpenIddictApplicationModel ToModel(this OpenIddictApplication entity) |
|
|
|
{ |
|
|
|
if(model == null) |
|
|
|
if(entity == null) |
|
|
|
{ |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
return new OpenIddictApplicationModel |
|
|
|
var model = new OpenIddictApplicationModel |
|
|
|
{ |
|
|
|
Id = model.Id, |
|
|
|
ClientId = model.ClientId, |
|
|
|
ClientSecret = model.ClientSecret, |
|
|
|
ConsentType = model.ConsentType, |
|
|
|
DisplayName = model.DisplayName, |
|
|
|
DisplayNames = model.DisplayNames, |
|
|
|
Permissions = model.Permissions, |
|
|
|
PostLogoutRedirectUris = model.PostLogoutRedirectUris, |
|
|
|
Properties = model.Properties, |
|
|
|
RedirectUris = model.RedirectUris, |
|
|
|
Requirements = model.Requirements, |
|
|
|
Type = model.Type |
|
|
|
Id = entity.Id, |
|
|
|
ClientId = entity.ClientId, |
|
|
|
ClientSecret = entity.ClientSecret, |
|
|
|
ConsentType = entity.ConsentType, |
|
|
|
DisplayName = entity.DisplayName, |
|
|
|
DisplayNames = entity.DisplayNames, |
|
|
|
Permissions = entity.Permissions, |
|
|
|
PostLogoutRedirectUris = entity.PostLogoutRedirectUris, |
|
|
|
Properties = entity.Properties, |
|
|
|
RedirectUris = entity.RedirectUris, |
|
|
|
Requirements = entity.Requirements, |
|
|
|
Type = entity.Type |
|
|
|
}; |
|
|
|
|
|
|
|
foreach (var extraProperty in entity.ExtraProperties) |
|
|
|
{ |
|
|
|
model.ExtraProperties.Add(extraProperty.Key, extraProperty.Value); |
|
|
|
} |
|
|
|
|
|
|
|
return model; |
|
|
|
} |
|
|
|
} |
|
|
|
|