protected virtual async Task AddIdentityResourceIfNotExistsAsync(IdentityServer4.Models.IdentityResource resource) { if (await IdentityResourceRepository.CheckNameExistAsync(resource.Name)) { return; } await IdentityResourceRepository.InsertAsync( new IdentityResource( GuidGenerator.Create(), resource ) ); }