19 lines
523 B
C#
19 lines
523 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace Lookup.Database.Configurations;
|
|
|
|
internal class LookupConfiguration<TKey, TValue>
|
|
: IEntityTypeConfiguration<IKeyEntity<TKey, TValue>>
|
|
where TKey : class, IKeyEntity<TKey, TValue>
|
|
where TValue : class, IValueEntity<TKey, TValue>
|
|
{
|
|
/// <inheritdoc />
|
|
public void Configure(EntityTypeBuilder<IKeyEntity<TKey, TValue>> builder)
|
|
{
|
|
builder
|
|
.HasMany(e => e.Values)
|
|
.WithMany(e => e.Keys);
|
|
}
|
|
}
|