mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
ce013eae49
+ InvitesRepository + AdminsRepository + rework jwt
18 lines
521 B
C#
18 lines
521 B
C#
using Govor.Core.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace Govor.Data.Configurations;
|
|
|
|
public class InvitationConfiguration : IEntityTypeConfiguration<Invitation>
|
|
{
|
|
public void Configure(EntityTypeBuilder<Invitation> builder)
|
|
{
|
|
builder.HasKey(i => i.Id);
|
|
|
|
builder.HasMany(i => i.Users)
|
|
.WithOne(u => u.Invite)
|
|
.HasForeignKey(u => u.InviteId)
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
}
|
|
} |