19 lines
582 B
C#
19 lines
582 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
using xAiApi.AI.Models.Entities;
|
|
|
|
namespace xAiApi.AI.Configuration.Entities
|
|
{
|
|
public class XAiMessageConfiguration : IEntityTypeConfiguration<XAiMessage>
|
|
{
|
|
public void Configure(EntityTypeBuilder<XAiMessage> builder)
|
|
{
|
|
//
|
|
builder
|
|
.HasOne(x => x.Conversation)
|
|
.WithMany(x => x.Messages)
|
|
.HasForeignKey(x => x.ConversationId)
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
}
|
|
}
|
|
} |