0

저는 ASP.Net Core 및 Identity Server 4를 사용하는 프로젝트 작업 중입니다.이 프로젝트는 Identity Server 모델을 저장하기 위해 Entity Framework Core를 사용하고 있습니다.IdentityServer 4 모델을 확장 할 수 있습니까?

Startup.cs

var identityServer = services.AddIdentityServer() 
      .AddTemporarySigningCredential() 
      .AddConfigurationStore(builder => builder.UseSqlServer(connectionString, 
       options => options.MigrationsAssembly(migrationsAssembly))) 
      .AddOperationalStore(builder => builder.UseSqlServer(connectionString, 
       options => options.MigrationsAssembly(migrationsAssembly))) 
      .AddAspNetIdentity<ApplicationUser>() 
      .AddProfileService<IdentityProfileService>(); 

를 목적 :

Identity Server를 자체 DbContexts (ConfigurationDbContext 및 PersistedGrantsDbContext)와이 컨텍스트과 같이, 프로젝트의 시작 파일에 주입 생성 프로젝트의 모든 모델은 업데이트하는 동안 동시성 문제를 파악하기 위해 행 버전 속성을 사용합니다. 모델

 /// <summary> 
    /// Concurrency stamp for model 
    /// </summary> 
    [Timestamp] 
    public byte[] RowVersion { get; set; } 

질문은,에

속성 정의는 우리가 어떻게 IdentityServer 4의 기본 모델을 확장 할 수 있습니다? 또한 우리는 그러한 모델을 확장하려고 노력해야합니까?

나는 조언, 제안 및 대안을 제공합니다.
감사합니다.

답변

0

파생 클래스를 만들면 RowVersion 필드를 추가 할 수 있습니다. 내장 된 ConfigurationDbContext가 파생 된 클래스를 사용할 수 없으므로 데이터베이스에 읽고 쓸 수있는 다른 모든 데이터 액세스 계층을 만들어야합니다.

내 자신의 모델을 만들고 Dapper를 사용하여 이와 같은 관리 기능을 사용할 수 있습니다.