last ...
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
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)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using xAiApi.AI.Models.Entities;
|
||||
|
||||
namespace xAiApi.AI.Configuration.Entities
|
||||
{
|
||||
public class XAiProjectConfiguration : IEntityTypeConfiguration<XAiProject>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<XAiProject> builder)
|
||||
{
|
||||
//
|
||||
// Configure Navigations ...
|
||||
builder
|
||||
.HasMany(x => x.Conversations)
|
||||
.WithOne(x => x.Project)
|
||||
.HasForeignKey(x => x.ProjectId)
|
||||
.OnDelete(DeleteBehavior.NoAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user