mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
fix(dir): 🐛 command context model config
This commit is contained in:
parent
c293405a17
commit
e6f6ae56b2
2 changed files with 18 additions and 0 deletions
|
|
@ -13,6 +13,8 @@ public virtual void Configure(EntityTypeBuilder<Change> builder)
|
|||
{
|
||||
// TODO: register and resolve INameRewriter
|
||||
var nr = new SnakeCaseNameRewriter(CultureInfo.InvariantCulture);
|
||||
|
||||
builder.ToTable($"{nr.RewriteName(nameof(Change))}s");
|
||||
builder.Property<int>(nameof(Queries.Entities.Change.Id));
|
||||
|
||||
// TODO: TDiscriminator should really be AggregateType rather than string but needs name rewriting
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
using FilterLists.Directory.Domain.Aggregates.Changes;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace FilterLists.Directory.Infrastructure.Persistence.Commands.EntityTypeConfigurations;
|
||||
|
||||
internal class FilterListChangeTypeConfiguration : IEntityTypeConfiguration<FilterListChange>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<FilterListChange> builder)
|
||||
{
|
||||
// TODO: share by configuring IChange<TAggregate>
|
||||
// TODO: serialize/deserialize json via value converter
|
||||
builder.Ignore(c => c.Before);
|
||||
builder.Ignore(c => c.After);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue