Switch Owned value types to ComplexProperty which is better fit.
This requires fluent configuration. Also made some conversion registration context wide.
This commit is contained in:
parent
07393f57fc
commit
1a8c63808a
11 changed files with 93 additions and 54 deletions
|
|
@ -2,6 +2,8 @@ using System.ComponentModel.DataAnnotations;
|
|||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using IdentityShroud.Core.Contracts;
|
||||
using IdentityShroud.Core.Security;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace IdentityShroud.Core.Model;
|
||||
|
||||
|
|
@ -13,5 +15,15 @@ public class ClientSecret
|
|||
public Guid ClientId { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime? RevokedAt { get; set; }
|
||||
public required EncryptedValue Secret { get; set; }
|
||||
public EncryptedValue? Secret { get; set; }
|
||||
}
|
||||
|
||||
public class ClientSecretConfiguration : IEntityTypeConfiguration<ClientSecret>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ClientSecret> b)
|
||||
{
|
||||
b.ToTable("client_secret");
|
||||
b.HasKey(e => e.Id);
|
||||
b.ComplexProperty(e => e.Secret);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue