21 lines
652 B
C#
21 lines
652 B
C#
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
using xAiApi.AI.Models.Entities;
|
|
|
|
namespace xAiApi.AI.Configuration.Entities
|
|
{
|
|
public class XAiConversationConfiguration : IEntityTypeConfiguration<XAiConversation>
|
|
{
|
|
public void Configure(EntityTypeBuilder<XAiConversation> builder)
|
|
{
|
|
//
|
|
// Configure Navigations ...
|
|
builder
|
|
.HasMany(x => x.Messages)
|
|
.WithOne(x => x.Conversation)
|
|
.HasForeignKey(x => x.ConversationId)
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
}
|
|
}
|
|
} |