This repository has been archived on 2024-06-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2023-08-10 09:04:36 +02:00

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);
}
}