Files
IM_NEW/MessageService.Infrastructure/Configs/ConversationConfig.cs
T

19 lines
587 B
C#

using MessageService.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace MessageService.Infrastructure.Configs
{
public class ConversationConfig : IEntityTypeConfiguration<Conversation>
{
public void Configure(EntityTypeBuilder<Conversation> builder)
{
builder.ToTable("conversations");
builder.HasKey(x => x.Id);
builder.HasIndex(x => x.UserId);
builder.HasIndex(x => new { x.UserId, x.ChatType, x.TargetId, x.IsDeleted });
}
}
}