mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 11:44:56 +00:00
18 lines
501 B
C#
18 lines
501 B
C#
using Govor.Core.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace Govor.Data.Configurations;
|
|
|
|
public class MessageViewConfiguration : IEntityTypeConfiguration<MessageView>
|
|
{
|
|
public void Configure(EntityTypeBuilder<MessageView> builder)
|
|
{
|
|
builder.HasKey(mv => mv.Id);
|
|
|
|
builder.HasIndex(mv => new { mv.MessageId, mv.UserId }).IsUnique();
|
|
|
|
builder.Property(mv => mv.ViewedAt)
|
|
.IsRequired();
|
|
}
|
|
} |