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
24
IdentityShroud.Core/Model/RealmDek.cs
Normal file
24
IdentityShroud.Core/Model/RealmDek.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using IdentityShroud.Core.Security;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace IdentityShroud.Core.Model;
|
||||
|
||||
public record RealmDek
|
||||
{
|
||||
public required DekId Id { get; init; }
|
||||
public required bool Active { get; set; }
|
||||
public required string Algorithm { get; init; }
|
||||
public required EncryptedDek KeyData { get; init; }
|
||||
public required Guid RealmId { get; init; }
|
||||
}
|
||||
|
||||
public class RealmDekConfiguration : IEntityTypeConfiguration<RealmDek>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<RealmDek> b)
|
||||
{
|
||||
b.ToTable("realm_dek");
|
||||
b.HasKey(e => e.Id);
|
||||
b.ComplexProperty(e => e.KeyData, e => e.IsRequired());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue