last ...
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using xAiModels.Constants;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Configurations.Entities
|
||||
{
|
||||
public class XAiConversationEntityConfiguration : XBaseEntityTypeConfiguration<XAiConversation, Guid>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<XAiConversation> builder)
|
||||
{
|
||||
builder.ToTable(XAiModelsConstants.XAiConversationTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using xAiModels.Constants;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Configurations.Entities
|
||||
{
|
||||
public class XAiMessageEntityConfiguration : XBaseEntityTypeConfiguration<XAiMessage, Guid>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<XAiMessage> builder)
|
||||
{
|
||||
builder.ToTable(XAiModelsConstants.XAiMessageTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using xAiModels.Constants;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Configurations.Entities
|
||||
{
|
||||
public class XAiProjectEntityConfiguration : XBaseEntityTypeConfiguration<XAiProject, Guid>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<XAiProject> builder)
|
||||
{
|
||||
builder.ToTable(XAiModelsConstants.XAiProjectTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
namespace xAiModels.Constants
|
||||
{
|
||||
public struct XAiModelsConstants
|
||||
{
|
||||
//
|
||||
// Table Mapping Identifiers ...
|
||||
public const string XAiMessageTable = "AiMessages";
|
||||
public const string XAiProjectTable = "AiProjects";
|
||||
public const string XAiConversationTable = "AiConversations";
|
||||
|
||||
//
|
||||
// GraphQL Collection Mappings ...
|
||||
public const string XAiMessageSingleName = "aiMessage";
|
||||
public const string XAiProjectSingleName = "aiProject";
|
||||
public const string XAiConversationSignleName = "aiConversation";
|
||||
|
||||
public const string XAiMessageCollectionName = "aiMessages";
|
||||
public const string XAiProjectCollectionName = "AiProjectsa";
|
||||
public const string XAiConversationCollectionName = "aiConversations";
|
||||
|
||||
//
|
||||
// Resource Provider Identifiers ...
|
||||
public const string XAiProjectTitleIdentifier = "AiPrjT";
|
||||
public const string XAiProjectDescriptionIdentifier = "AiPrjD";
|
||||
public const string XAiConversationTitleIdentifier = "AiCnvrT";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,429 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using xAiModels.Providers.Entities;
|
||||
using xDataService.Constants;
|
||||
using xDataService.Db;
|
||||
using xPushService.Helpers;
|
||||
|
||||
namespace xAiModels.DI
|
||||
{
|
||||
public static class XDIHelperExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// Register Service ...
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <param name="repositoryType"></param>
|
||||
/// <param name="lifeTime"></param>
|
||||
public static void AddXAiDataServiceService(
|
||||
this IServiceCollection services,
|
||||
XRepositoryType repositoryType,
|
||||
ServiceLifetime lifeTime = ServiceLifetime.Scoped
|
||||
)
|
||||
{
|
||||
AddAiDataServiceService(
|
||||
contextType: null,
|
||||
services: services,
|
||||
lifeTime: lifeTime,
|
||||
repositoryType: repositoryType
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register Service ...
|
||||
/// </summary>
|
||||
/// <typeparam name="TContext"></typeparam>
|
||||
/// <param name="services"></param>
|
||||
/// <param name="repositoryType"></param>
|
||||
/// <param name="lifeTime"></param>
|
||||
public static void AddXAiDataServiceService<TContext>(
|
||||
this IServiceCollection services,
|
||||
XRepositoryType repositoryType,
|
||||
ServiceLifetime lifeTime = ServiceLifetime.Scoped
|
||||
)
|
||||
where TContext : XDbContext
|
||||
{
|
||||
AddAiDataServiceService(
|
||||
services: services,
|
||||
lifeTime: lifeTime,
|
||||
contextType: typeof(TContext),
|
||||
repositoryType: repositoryType
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use XSubCategoryService Middleware ...
|
||||
/// </summary>
|
||||
/// <param name="app"></param>
|
||||
/// <param name="isDevelopmentEnvironment"></param>
|
||||
public static void UseXAiDataServiceService(
|
||||
this IApplicationBuilder app,
|
||||
bool isDevelopmentEnvironment = false
|
||||
)
|
||||
{
|
||||
//
|
||||
#region Using Hubs ...
|
||||
//
|
||||
var pushHelper = new XPushServiceHelper();
|
||||
|
||||
//
|
||||
// XAiConversation ...
|
||||
pushHelper.AddHub<XAiConversationEntityHub>("categoryDto");
|
||||
pushHelper.AddHub<XAiDataServiceEntityHub>("categoryEntity");
|
||||
|
||||
//
|
||||
// SubCategory ...
|
||||
pushHelper.AddHub<XSubCategoryDtoHub>("subCategoryDto");
|
||||
pushHelper.AddHub<XSubCategoryEntityHub>("subCategoryEntity");
|
||||
|
||||
//
|
||||
app.UseXPushService(pushHelper);
|
||||
#endregion
|
||||
|
||||
//
|
||||
// Using XAiDataService Repository Descriptor ...
|
||||
if (!categoryDescriptor.IsNull())
|
||||
{
|
||||
//
|
||||
app.UseXRepository(
|
||||
descriptor: categoryDescriptor,
|
||||
isDevelopmentEnvironment: isDevelopmentEnvironment
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Using XSubCategory Repository Descriptor ...
|
||||
if (!subCategoryDescriptor.IsNull())
|
||||
{
|
||||
//
|
||||
app.UseXRepository(
|
||||
descriptor: subCategoryDescriptor,
|
||||
isDevelopmentEnvironment: isDevelopmentEnvironment
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Create an Scope for Services Acces ...
|
||||
// Handle Seeding Category/SubCategory Resources ...
|
||||
using (var scope = app.ApplicationServices.CreateScope())
|
||||
{
|
||||
//
|
||||
// Retrieve Configuratuions ...
|
||||
var categoryProvider = scope.ServiceProvider.GetService<IXAiDataServiceProvider>();
|
||||
var subCategoryProvider = scope.ServiceProvider.GetService<IXSubCategoryProvider>();
|
||||
var configuration = scope.ServiceProvider.GetService<XAiDataServiceServiceConfiguration>();
|
||||
if (!configuration.IsNullOrDefault() &&
|
||||
!categoryProvider.IsNullOrDefault() &&
|
||||
!subCategoryDescriptor.IsNullOrDefault()
|
||||
)
|
||||
{
|
||||
//
|
||||
// Logging ...
|
||||
Log("Start Seeding ...");
|
||||
|
||||
//
|
||||
// Count Data in Category ...
|
||||
var hasCategory = (categoryProvider.Count().GetAwaiter().GetResult()) > 0;
|
||||
var hasSubCategory = (subCategoryProvider.Count().GetAwaiter().GetResult()) > 0;
|
||||
|
||||
//
|
||||
// Seed Category Resources ...
|
||||
var canSeed =
|
||||
!hasCategory &&
|
||||
configuration.Categories.HasChild();
|
||||
if (canSeed)
|
||||
{
|
||||
//
|
||||
// Loop through Provided items ...
|
||||
foreach (var cat in configuration.Categories)
|
||||
{
|
||||
//
|
||||
try
|
||||
{
|
||||
//
|
||||
Log($"Start Seeding Category: {cat.Titles.Locales.ToArray()[0].Value} ...");
|
||||
|
||||
//
|
||||
categoryProvider.Refresh(
|
||||
resource: cat,
|
||||
userInfo: null,
|
||||
connectionId: null,
|
||||
cancellationToken: default
|
||||
)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
//
|
||||
Log($"Seeding Category: {cat.Titles.Locales.ToArray()[0].Value} Finished Successfully ...");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log($"Seeding Category: {cat.Titles.Locales.ToArray()[0].Value} Failed due: {ex.Message} ...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Seed SubCategory Resources ...
|
||||
canSeed =
|
||||
!hasSubCategory &&
|
||||
configuration.SubCategories.HasChild();
|
||||
if (canSeed)
|
||||
{
|
||||
//
|
||||
// Loop through Provided items ...
|
||||
foreach (var subcat in configuration.SubCategories)
|
||||
{
|
||||
//
|
||||
try
|
||||
{
|
||||
//
|
||||
Log($"Start Seeding SubCategory: {subcat.Titles.Locales.ToArray()[0].Value} ...");
|
||||
|
||||
//
|
||||
subCategoryProvider.Refresh(
|
||||
userInfo: null,
|
||||
resource: subcat,
|
||||
connectionId: null,
|
||||
cancellationToken: default
|
||||
)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
//
|
||||
Log($"Seeding SubCategory: {subcat.Titles.Locales.ToArray()[0].Value} Finished Successfully ...");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log($"Seeding SubCategory: {subcat.Titles.Locales.ToArray()[0].Value} Failed due: {ex.Message} ...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
Log("Finish Seeding ...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
#region Private ...
|
||||
private static XRepositoryDescriptor categoryDescriptor = null;
|
||||
private static XRepositoryDescriptor subCategoryDescriptor = null;
|
||||
|
||||
/// <summary>
|
||||
/// a LogTag for Service ...
|
||||
/// </summary>
|
||||
private static string XLogTag = "XAiDataServiceService";
|
||||
|
||||
/// <summary>
|
||||
/// print a log in Console ...
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
private static void Log(string message)
|
||||
{
|
||||
Console.WriteLine($"{XLogTag} => {message}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register Service ...
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <param name="repositoryType"></param>
|
||||
/// <param name="contextType"></param>
|
||||
/// <param name="lifeTime"></param>
|
||||
private static void AddCategoryService(
|
||||
IServiceCollection services,
|
||||
XRepositoryType repositoryType,
|
||||
Type contextType = null,
|
||||
ServiceLifetime lifeTime = ServiceLifetime.Scoped
|
||||
)
|
||||
{
|
||||
//
|
||||
var exception = XException.InvalidArgs.ToException(); ;
|
||||
|
||||
//
|
||||
// Services ...
|
||||
var isServicesExists = !services.IsNull();
|
||||
if (!isServicesExists)
|
||||
{
|
||||
//
|
||||
Log("Service Registration failed, services not provided ...");
|
||||
throw exception;
|
||||
}
|
||||
|
||||
//
|
||||
// Lifetime ...
|
||||
var isLifetimeExists = !lifeTime.IsNull();
|
||||
if (!isLifetimeExists)
|
||||
{
|
||||
//
|
||||
Log("Service Registration failed, lifetime not provided ...");
|
||||
throw exception;
|
||||
}
|
||||
|
||||
//
|
||||
// Validate Repository Type ...
|
||||
var isRepositoryTypeValid =
|
||||
(repositoryType == XRepositoryType.EF &&
|
||||
!contextType.IsNull()) ||
|
||||
((repositoryType == XRepositoryType.Mongo ||
|
||||
repositoryType == XRepositoryType.InMemory) &&
|
||||
contextType.IsNull());
|
||||
if (!isRepositoryTypeValid)
|
||||
{
|
||||
//
|
||||
Log("Service Registration failed, Invalid Repository Type and Context Type ...");
|
||||
throw exception;
|
||||
}
|
||||
|
||||
//
|
||||
// Maske Instance of Repository Descriptor
|
||||
// Based on Provided Type ...
|
||||
switch (repositoryType)
|
||||
{
|
||||
//
|
||||
case XRepositoryType.EF:
|
||||
//
|
||||
// Category ...
|
||||
categoryDescriptor = typeof(XAiDataServiceServiceHelper)
|
||||
.InvokeGenericMethod<XRepositoryDescriptor>(
|
||||
methodName: "GetXAiDataServiceEFRepositoryDescriptor",
|
||||
runtimeType: contextType,
|
||||
args: null
|
||||
);
|
||||
|
||||
//
|
||||
// SubCategory ...
|
||||
subCategoryDescriptor = typeof(XAiDataServiceServiceHelper)
|
||||
.InvokeGenericMethod<XRepositoryDescriptor>(
|
||||
methodName: "GetXSubCategoryEFRepositoryDescriptor",
|
||||
runtimeType: contextType,
|
||||
args: null
|
||||
);
|
||||
break;
|
||||
|
||||
//
|
||||
case XRepositoryType.Mongo:
|
||||
//
|
||||
// Category ...
|
||||
categoryDescriptor = XAiDataServiceServiceHelper.GetXAiDataServiceMongoRepositoryDescriptor();
|
||||
|
||||
//
|
||||
// SubCategory ...
|
||||
subCategoryDescriptor = XAiDataServiceServiceHelper.GetXSubCategoryMongoRepositoryDescriptor();
|
||||
break;
|
||||
|
||||
//
|
||||
case XRepositoryType.InMemory:
|
||||
//
|
||||
// Category ...
|
||||
categoryDescriptor = XAiDataServiceServiceHelper.GetXAiDataServiceInMemoryRepositoryDescriptor();
|
||||
|
||||
//
|
||||
// SubCategory ...
|
||||
subCategoryDescriptor = XAiDataServiceServiceHelper.GetXSubCategoryInMemoryRepositoryDescriptor();
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
// Register Category Repository Descriptor ...
|
||||
if (!categoryDescriptor.IsNull())
|
||||
{
|
||||
//
|
||||
services.AddXRepository(
|
||||
lifeTime: lifeTime,
|
||||
descriptor: categoryDescriptor
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Register SubCategory Repository Descriptor ...
|
||||
if (!subCategoryDescriptor.IsNull())
|
||||
{
|
||||
//
|
||||
services.AddXRepository(
|
||||
lifeTime: lifeTime,
|
||||
descriptor: subCategoryDescriptor
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
#region Register Services ...
|
||||
//
|
||||
#region Category ...
|
||||
//
|
||||
// Models ...
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXAiDataServiceServiceProvider), typeof(XAiDataServiceServiceProvider), lifeTime)
|
||||
);
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXAiDataServiceRepositoryService), typeof(XAiDataServiceRepositoryService), lifeTime)
|
||||
);
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXAiDataServiceRepositoryProvider), typeof(XAiDataServiceRepositoryProvider), lifeTime)
|
||||
);
|
||||
|
||||
//
|
||||
// Resource Providers ...
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXAiDataServiceTitleResourceProvider), typeof(XAiDataServiceTitleResourceProvider), lifeTime)
|
||||
);
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXAiDataServiceDescriptionResourceProvider), typeof(XAiDataServiceDescriptionResourceProvider), lifeTime)
|
||||
);
|
||||
|
||||
//
|
||||
// Reference Providers ...
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXAiDataServiceSubCategoryReferenceProvider), typeof(XAiDataServiceSubCategoryReferenceProvider), lifeTime)
|
||||
);
|
||||
|
||||
//
|
||||
// Provider ...
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXAiDataServiceProvider), typeof(XAiDataServiceProvider), lifeTime)
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region SubCategory ...
|
||||
//
|
||||
// Models ...
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXSubCategoryServiceProvider), typeof(XSubCategoryServiceProvider), lifeTime)
|
||||
);
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXSubCategoryRepositoryService), typeof(XSubCategoryRepositoryService), lifeTime)
|
||||
);
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXSubCategoryRepositoryProvider), typeof(XSubCategoryRepositoryProvider), lifeTime)
|
||||
);
|
||||
|
||||
//
|
||||
// Resource Providers ...
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXSubCategoryTitleResourceProvider), typeof(XSubCategoryTitleResourceProvider), lifeTime)
|
||||
);
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXSubCategoryDescriptionResourceProvider), typeof(XSubCategoryDescriptionResourceProvider), lifeTime)
|
||||
);
|
||||
|
||||
//
|
||||
// Provider ...
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXSubCategoryProvider), typeof(XSubCategoryProvider), lifeTime)
|
||||
);
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
//
|
||||
Log("Service Regitration Succeed ...");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,816 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xAiModels.Providers.Entities;
|
||||
using xAiModels.Providers.GraphQL;
|
||||
using xDataService.Db;
|
||||
using xDataService.Models;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Helpers
|
||||
{
|
||||
public static class XAiModelsHelper
|
||||
{
|
||||
//
|
||||
#region XAiConversation ...
|
||||
//
|
||||
#region EF Repository Descriptor Provider(s) ...
|
||||
public static XEFRepositoryDescriptor<
|
||||
XAiConversation,
|
||||
Guid,
|
||||
IXAiConversationKeyGenerator,
|
||||
XAiConversationKeyGenerator,
|
||||
IXAiConversationRepositoryEvents,
|
||||
XAiConversationRepositoryEvents,
|
||||
XAiConversationGraphType,
|
||||
GuidGraphType,
|
||||
XAiConversationGraphQuery,
|
||||
IXAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphSchema,
|
||||
IXAiConversationRepository,
|
||||
XAiConversationEFRepository<TContext>,
|
||||
TContext
|
||||
> GetXAiConversationEFRepositoryDescriptor<TContext>()
|
||||
where TContext : XDbContext
|
||||
{
|
||||
//
|
||||
var result = new XEFRepositoryDescriptor<
|
||||
XAiConversation,
|
||||
Guid,
|
||||
IXAiConversationKeyGenerator,
|
||||
XAiConversationKeyGenerator,
|
||||
IXAiConversationRepositoryEvents,
|
||||
XAiConversationRepositoryEvents,
|
||||
XAiConversationGraphType,
|
||||
GuidGraphType,
|
||||
XAiConversationGraphQuery,
|
||||
IXAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphSchema,
|
||||
IXAiConversationRepository,
|
||||
XAiConversationEFRepository<TContext>,
|
||||
TContext
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public static XEFRepositoryDescriptor<
|
||||
XAiConversation,
|
||||
Guid,
|
||||
IXAiConversationKeyGenerator,
|
||||
XAiConversationKeyGenerator,
|
||||
IXAiConversationRepositoryEvents,
|
||||
XAiConversationRepositoryEvents,
|
||||
XAiConversationGraphType,
|
||||
GuidGraphType,
|
||||
XAiConversationGraphQuery,
|
||||
IXAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphSchema,
|
||||
IXAiConversationRepository,
|
||||
XAiConversationEFRepository<TContext>,
|
||||
TContext,
|
||||
IXAiConversationSeeder,
|
||||
TSeederImplementation
|
||||
> GetXAiConversationEFRepositoryDescriptor<TContext, TSeederImplementation>()
|
||||
where TContext : XDbContext
|
||||
where TSeederImplementation : XBaseDbSeeder<XAiConversation, Guid>
|
||||
{
|
||||
//
|
||||
var result = new XEFRepositoryDescriptor<
|
||||
XAiConversation,
|
||||
Guid,
|
||||
IXAiConversationKeyGenerator,
|
||||
XAiConversationKeyGenerator,
|
||||
IXAiConversationRepositoryEvents,
|
||||
XAiConversationRepositoryEvents,
|
||||
XAiConversationGraphType,
|
||||
GuidGraphType,
|
||||
XAiConversationGraphQuery,
|
||||
IXAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphSchema,
|
||||
IXAiConversationRepository,
|
||||
XAiConversationEFRepository<TContext>,
|
||||
TContext,
|
||||
IXAiConversationSeeder,
|
||||
TSeederImplementation
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Mongo Repository Descriptor Provider(s) ...
|
||||
public static XMongoRepositoryDescriptor<
|
||||
XAiConversation,
|
||||
Guid,
|
||||
IXAiConversationKeyGenerator,
|
||||
XAiConversationKeyGenerator,
|
||||
IXAiConversationRepositoryEvents,
|
||||
XAiConversationRepositoryEvents,
|
||||
XAiConversationGraphType,
|
||||
GuidGraphType,
|
||||
XAiConversationGraphQuery,
|
||||
IXAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphSchema,
|
||||
IXAiConversationRepository,
|
||||
XAiConversationMongoRepository
|
||||
> GetXAiConversationMongoRepositoryDescriptor()
|
||||
{
|
||||
//
|
||||
var result = new XMongoRepositoryDescriptor<
|
||||
XAiConversation,
|
||||
Guid,
|
||||
IXAiConversationKeyGenerator,
|
||||
XAiConversationKeyGenerator,
|
||||
IXAiConversationRepositoryEvents,
|
||||
XAiConversationRepositoryEvents,
|
||||
XAiConversationGraphType,
|
||||
GuidGraphType,
|
||||
XAiConversationGraphQuery,
|
||||
IXAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphSchema,
|
||||
IXAiConversationRepository,
|
||||
XAiConversationMongoRepository
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public static XMongoRepositoryDescriptor<
|
||||
XAiConversation,
|
||||
Guid,
|
||||
IXAiConversationKeyGenerator,
|
||||
XAiConversationKeyGenerator,
|
||||
IXAiConversationRepositoryEvents,
|
||||
XAiConversationRepositoryEvents,
|
||||
XAiConversationGraphType,
|
||||
GuidGraphType,
|
||||
XAiConversationGraphQuery,
|
||||
IXAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphSchema,
|
||||
IXAiConversationRepository,
|
||||
XAiConversationMongoRepository,
|
||||
IXAiConversationSeeder,
|
||||
TSeederImplementation
|
||||
> GetXAiConversationMongoRepositoryDescriptor<TSeederImplementation>()
|
||||
where TSeederImplementation : XBaseDbSeeder<XAiConversation, Guid>
|
||||
{
|
||||
//
|
||||
var result = new XMongoRepositoryDescriptor<
|
||||
XAiConversation,
|
||||
Guid,
|
||||
IXAiConversationKeyGenerator,
|
||||
XAiConversationKeyGenerator,
|
||||
IXAiConversationRepositoryEvents,
|
||||
XAiConversationRepositoryEvents,
|
||||
XAiConversationGraphType,
|
||||
GuidGraphType,
|
||||
XAiConversationGraphQuery,
|
||||
IXAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphSchema,
|
||||
IXAiConversationRepository,
|
||||
XAiConversationMongoRepository,
|
||||
IXAiConversationSeeder,
|
||||
TSeederImplementation
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region InMemory Repository Descriptor Provider(s) ...
|
||||
public static XInMemoryRepositoryDescriptor<
|
||||
XAiConversation,
|
||||
Guid,
|
||||
IXAiConversationKeyGenerator,
|
||||
XAiConversationKeyGenerator,
|
||||
IXAiConversationRepositoryEvents,
|
||||
XAiConversationRepositoryEvents,
|
||||
XAiConversationGraphType,
|
||||
GuidGraphType,
|
||||
XAiConversationGraphQuery,
|
||||
IXAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphSchema,
|
||||
IXAiConversationRepository,
|
||||
XAiConversationInMemoryRepository
|
||||
> GetXAiConversationInMemoryRepositoryDescriptor()
|
||||
{
|
||||
//
|
||||
var result = new XInMemoryRepositoryDescriptor<
|
||||
XAiConversation,
|
||||
Guid,
|
||||
IXAiConversationKeyGenerator,
|
||||
XAiConversationKeyGenerator,
|
||||
IXAiConversationRepositoryEvents,
|
||||
XAiConversationRepositoryEvents,
|
||||
XAiConversationGraphType,
|
||||
GuidGraphType,
|
||||
XAiConversationGraphQuery,
|
||||
IXAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphSchema,
|
||||
IXAiConversationRepository,
|
||||
XAiConversationInMemoryRepository
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public static XInMemoryRepositoryDescriptor<
|
||||
XAiConversation,
|
||||
Guid,
|
||||
IXAiConversationKeyGenerator,
|
||||
XAiConversationKeyGenerator,
|
||||
IXAiConversationRepositoryEvents,
|
||||
XAiConversationRepositoryEvents,
|
||||
XAiConversationGraphType,
|
||||
GuidGraphType,
|
||||
XAiConversationGraphQuery,
|
||||
IXAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphSchema,
|
||||
IXAiConversationRepository,
|
||||
XAiConversationInMemoryRepository,
|
||||
IXAiConversationSeeder,
|
||||
TSeederImplementation
|
||||
> GetXAiConversationInMemoryRepositoryDescriptor<TSeederImplementation>()
|
||||
where TSeederImplementation : XBaseDbSeeder<XAiConversation, Guid>
|
||||
{
|
||||
//
|
||||
var result = new XInMemoryRepositoryDescriptor<
|
||||
XAiConversation,
|
||||
Guid,
|
||||
IXAiConversationKeyGenerator,
|
||||
XAiConversationKeyGenerator,
|
||||
IXAiConversationRepositoryEvents,
|
||||
XAiConversationRepositoryEvents,
|
||||
XAiConversationGraphType,
|
||||
GuidGraphType,
|
||||
XAiConversationGraphQuery,
|
||||
IXAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphQLTypeHelper,
|
||||
XAiConversationGraphSchema,
|
||||
IXAiConversationRepository,
|
||||
XAiConversationInMemoryRepository,
|
||||
IXAiConversationSeeder,
|
||||
TSeederImplementation
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region XAiMessage ...
|
||||
//
|
||||
#region EF Repository Descriptor Provider(s) ...
|
||||
public static XEFRepositoryDescriptor<
|
||||
XAiMessage,
|
||||
Guid,
|
||||
IXAiMessageKeyGenerator,
|
||||
XAiMessageKeyGenerator,
|
||||
IXAiMessageRepositoryEvents,
|
||||
XAiMessageRepositoryEvents,
|
||||
XAiMessageGraphType,
|
||||
GuidGraphType,
|
||||
XAiMessageGraphQuery,
|
||||
IXAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphSchema,
|
||||
IXAiMessageRepository,
|
||||
XAiMessageEFRepository<TContext>,
|
||||
TContext
|
||||
> GetXAiMessageEFRepositoryDescriptor<TContext>()
|
||||
where TContext : XDbContext
|
||||
{
|
||||
//
|
||||
var result = new XEFRepositoryDescriptor<
|
||||
XAiMessage,
|
||||
Guid,
|
||||
IXAiMessageKeyGenerator,
|
||||
XAiMessageKeyGenerator,
|
||||
IXAiMessageRepositoryEvents,
|
||||
XAiMessageRepositoryEvents,
|
||||
XAiMessageGraphType,
|
||||
GuidGraphType,
|
||||
XAiMessageGraphQuery,
|
||||
IXAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphSchema,
|
||||
IXAiMessageRepository,
|
||||
XAiMessageEFRepository<TContext>,
|
||||
TContext
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public static XEFRepositoryDescriptor<
|
||||
XAiMessage,
|
||||
Guid,
|
||||
IXAiMessageKeyGenerator,
|
||||
XAiMessageKeyGenerator,
|
||||
IXAiMessageRepositoryEvents,
|
||||
XAiMessageRepositoryEvents,
|
||||
XAiMessageGraphType,
|
||||
GuidGraphType,
|
||||
XAiMessageGraphQuery,
|
||||
IXAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphSchema,
|
||||
IXAiMessageRepository,
|
||||
XAiMessageEFRepository<TContext>,
|
||||
TContext,
|
||||
IXAiMessageSeeder,
|
||||
TSeederImplementation
|
||||
> GetXAiMessageEFRepositoryDescriptor<TContext, TSeederImplementation>()
|
||||
where TContext : XDbContext
|
||||
where TSeederImplementation : XBaseDbSeeder<XAiMessage, Guid>
|
||||
{
|
||||
//
|
||||
var result = new XEFRepositoryDescriptor<
|
||||
XAiMessage,
|
||||
Guid,
|
||||
IXAiMessageKeyGenerator,
|
||||
XAiMessageKeyGenerator,
|
||||
IXAiMessageRepositoryEvents,
|
||||
XAiMessageRepositoryEvents,
|
||||
XAiMessageGraphType,
|
||||
GuidGraphType,
|
||||
XAiMessageGraphQuery,
|
||||
IXAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphSchema,
|
||||
IXAiMessageRepository,
|
||||
XAiMessageEFRepository<TContext>,
|
||||
TContext,
|
||||
IXAiMessageSeeder,
|
||||
TSeederImplementation
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Mongo Repository Descriptor Provider(s) ...
|
||||
public static XMongoRepositoryDescriptor<
|
||||
XAiMessage,
|
||||
Guid,
|
||||
IXAiMessageKeyGenerator,
|
||||
XAiMessageKeyGenerator,
|
||||
IXAiMessageRepositoryEvents,
|
||||
XAiMessageRepositoryEvents,
|
||||
XAiMessageGraphType,
|
||||
GuidGraphType,
|
||||
XAiMessageGraphQuery,
|
||||
IXAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphSchema,
|
||||
IXAiMessageRepository,
|
||||
XAiMessageMongoRepository
|
||||
> GetXAiMessageMongoRepositoryDescriptor()
|
||||
{
|
||||
//
|
||||
var result = new XMongoRepositoryDescriptor<
|
||||
XAiMessage,
|
||||
Guid,
|
||||
IXAiMessageKeyGenerator,
|
||||
XAiMessageKeyGenerator,
|
||||
IXAiMessageRepositoryEvents,
|
||||
XAiMessageRepositoryEvents,
|
||||
XAiMessageGraphType,
|
||||
GuidGraphType,
|
||||
XAiMessageGraphQuery,
|
||||
IXAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphSchema,
|
||||
IXAiMessageRepository,
|
||||
XAiMessageMongoRepository
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public static XMongoRepositoryDescriptor<
|
||||
XAiMessage,
|
||||
Guid,
|
||||
IXAiMessageKeyGenerator,
|
||||
XAiMessageKeyGenerator,
|
||||
IXAiMessageRepositoryEvents,
|
||||
XAiMessageRepositoryEvents,
|
||||
XAiMessageGraphType,
|
||||
GuidGraphType,
|
||||
XAiMessageGraphQuery,
|
||||
IXAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphSchema,
|
||||
IXAiMessageRepository,
|
||||
XAiMessageMongoRepository,
|
||||
IXAiMessageSeeder,
|
||||
TSeederImplementation
|
||||
> GetXAiMessageMongoRepositoryDescriptor<TSeederImplementation>()
|
||||
where TSeederImplementation : XBaseDbSeeder<XAiMessage, Guid>
|
||||
{
|
||||
//
|
||||
var result = new XMongoRepositoryDescriptor<
|
||||
XAiMessage,
|
||||
Guid,
|
||||
IXAiMessageKeyGenerator,
|
||||
XAiMessageKeyGenerator,
|
||||
IXAiMessageRepositoryEvents,
|
||||
XAiMessageRepositoryEvents,
|
||||
XAiMessageGraphType,
|
||||
GuidGraphType,
|
||||
XAiMessageGraphQuery,
|
||||
IXAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphSchema,
|
||||
IXAiMessageRepository,
|
||||
XAiMessageMongoRepository,
|
||||
IXAiMessageSeeder,
|
||||
TSeederImplementation
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region InMemory Repository Descriptor Provider(s) ...
|
||||
public static XInMemoryRepositoryDescriptor<
|
||||
XAiMessage,
|
||||
Guid,
|
||||
IXAiMessageKeyGenerator,
|
||||
XAiMessageKeyGenerator,
|
||||
IXAiMessageRepositoryEvents,
|
||||
XAiMessageRepositoryEvents,
|
||||
XAiMessageGraphType,
|
||||
GuidGraphType,
|
||||
XAiMessageGraphQuery,
|
||||
IXAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphSchema,
|
||||
IXAiMessageRepository,
|
||||
XAiMessageInMemoryRepository
|
||||
> GetXAiMessageInMemoryRepositoryDescriptor()
|
||||
{
|
||||
//
|
||||
var result = new XInMemoryRepositoryDescriptor<
|
||||
XAiMessage,
|
||||
Guid,
|
||||
IXAiMessageKeyGenerator,
|
||||
XAiMessageKeyGenerator,
|
||||
IXAiMessageRepositoryEvents,
|
||||
XAiMessageRepositoryEvents,
|
||||
XAiMessageGraphType,
|
||||
GuidGraphType,
|
||||
XAiMessageGraphQuery,
|
||||
IXAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphSchema,
|
||||
IXAiMessageRepository,
|
||||
XAiMessageInMemoryRepository
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public static XInMemoryRepositoryDescriptor<
|
||||
XAiMessage,
|
||||
Guid,
|
||||
IXAiMessageKeyGenerator,
|
||||
XAiMessageKeyGenerator,
|
||||
IXAiMessageRepositoryEvents,
|
||||
XAiMessageRepositoryEvents,
|
||||
XAiMessageGraphType,
|
||||
GuidGraphType,
|
||||
XAiMessageGraphQuery,
|
||||
IXAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphSchema,
|
||||
IXAiMessageRepository,
|
||||
XAiMessageInMemoryRepository,
|
||||
IXAiMessageSeeder,
|
||||
TSeederImplementation
|
||||
> GetXAiMessageInMemoryRepositoryDescriptor<TSeederImplementation>()
|
||||
where TSeederImplementation : XBaseDbSeeder<XAiMessage, Guid>
|
||||
{
|
||||
//
|
||||
var result = new XInMemoryRepositoryDescriptor<
|
||||
XAiMessage,
|
||||
Guid,
|
||||
IXAiMessageKeyGenerator,
|
||||
XAiMessageKeyGenerator,
|
||||
IXAiMessageRepositoryEvents,
|
||||
XAiMessageRepositoryEvents,
|
||||
XAiMessageGraphType,
|
||||
GuidGraphType,
|
||||
XAiMessageGraphQuery,
|
||||
IXAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphQLTypeHelper,
|
||||
XAiMessageGraphSchema,
|
||||
IXAiMessageRepository,
|
||||
XAiMessageInMemoryRepository,
|
||||
IXAiMessageSeeder,
|
||||
TSeederImplementation
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region XAiProject ...
|
||||
//
|
||||
#region EF Repository Descriptor Provider(s) ...
|
||||
public static XEFRepositoryDescriptor<
|
||||
XAiProject,
|
||||
Guid,
|
||||
IXAiProjectKeyGenerator,
|
||||
XAiProjectKeyGenerator,
|
||||
IXAiProjectRepositoryEvents,
|
||||
XAiProjectRepositoryEvents,
|
||||
XAiProjectGraphType,
|
||||
GuidGraphType,
|
||||
XAiProjectGraphQuery,
|
||||
IXAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphSchema,
|
||||
IXAiProjectRepository,
|
||||
XAiProjectEFRepository<TContext>,
|
||||
TContext
|
||||
> GetXAiProjectEFRepositoryDescriptor<TContext>()
|
||||
where TContext : XDbContext
|
||||
{
|
||||
//
|
||||
var result = new XEFRepositoryDescriptor<
|
||||
XAiProject,
|
||||
Guid,
|
||||
IXAiProjectKeyGenerator,
|
||||
XAiProjectKeyGenerator,
|
||||
IXAiProjectRepositoryEvents,
|
||||
XAiProjectRepositoryEvents,
|
||||
XAiProjectGraphType,
|
||||
GuidGraphType,
|
||||
XAiProjectGraphQuery,
|
||||
IXAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphSchema,
|
||||
IXAiProjectRepository,
|
||||
XAiProjectEFRepository<TContext>,
|
||||
TContext
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public static XEFRepositoryDescriptor<
|
||||
XAiProject,
|
||||
Guid,
|
||||
IXAiProjectKeyGenerator,
|
||||
XAiProjectKeyGenerator,
|
||||
IXAiProjectRepositoryEvents,
|
||||
XAiProjectRepositoryEvents,
|
||||
XAiProjectGraphType,
|
||||
GuidGraphType,
|
||||
XAiProjectGraphQuery,
|
||||
IXAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphSchema,
|
||||
IXAiProjectRepository,
|
||||
XAiProjectEFRepository<TContext>,
|
||||
TContext,
|
||||
IXAiProjectSeeder,
|
||||
TSeederImplementation
|
||||
> GetXAiProjectEFRepositoryDescriptor<TContext, TSeederImplementation>()
|
||||
where TContext : XDbContext
|
||||
where TSeederImplementation : XBaseDbSeeder<XAiProject, Guid>
|
||||
{
|
||||
//
|
||||
var result = new XEFRepositoryDescriptor<
|
||||
XAiProject,
|
||||
Guid,
|
||||
IXAiProjectKeyGenerator,
|
||||
XAiProjectKeyGenerator,
|
||||
IXAiProjectRepositoryEvents,
|
||||
XAiProjectRepositoryEvents,
|
||||
XAiProjectGraphType,
|
||||
GuidGraphType,
|
||||
XAiProjectGraphQuery,
|
||||
IXAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphSchema,
|
||||
IXAiProjectRepository,
|
||||
XAiProjectEFRepository<TContext>,
|
||||
TContext,
|
||||
IXAiProjectSeeder,
|
||||
TSeederImplementation
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Mongo Repository Descriptor Provider(s) ...
|
||||
public static XMongoRepositoryDescriptor<
|
||||
XAiProject,
|
||||
Guid,
|
||||
IXAiProjectKeyGenerator,
|
||||
XAiProjectKeyGenerator,
|
||||
IXAiProjectRepositoryEvents,
|
||||
XAiProjectRepositoryEvents,
|
||||
XAiProjectGraphType,
|
||||
GuidGraphType,
|
||||
XAiProjectGraphQuery,
|
||||
IXAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphSchema,
|
||||
IXAiProjectRepository,
|
||||
XAiProjectMongoRepository
|
||||
> GetXAiProjectMongoRepositoryDescriptor()
|
||||
{
|
||||
//
|
||||
var result = new XMongoRepositoryDescriptor<
|
||||
XAiProject,
|
||||
Guid,
|
||||
IXAiProjectKeyGenerator,
|
||||
XAiProjectKeyGenerator,
|
||||
IXAiProjectRepositoryEvents,
|
||||
XAiProjectRepositoryEvents,
|
||||
XAiProjectGraphType,
|
||||
GuidGraphType,
|
||||
XAiProjectGraphQuery,
|
||||
IXAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphSchema,
|
||||
IXAiProjectRepository,
|
||||
XAiProjectMongoRepository
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public static XMongoRepositoryDescriptor<
|
||||
XAiProject,
|
||||
Guid,
|
||||
IXAiProjectKeyGenerator,
|
||||
XAiProjectKeyGenerator,
|
||||
IXAiProjectRepositoryEvents,
|
||||
XAiProjectRepositoryEvents,
|
||||
XAiProjectGraphType,
|
||||
GuidGraphType,
|
||||
XAiProjectGraphQuery,
|
||||
IXAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphSchema,
|
||||
IXAiProjectRepository,
|
||||
XAiProjectMongoRepository,
|
||||
IXAiProjectSeeder,
|
||||
TSeederImplementation
|
||||
> GetXAiProjectMongoRepositoryDescriptor<TSeederImplementation>()
|
||||
where TSeederImplementation : XBaseDbSeeder<XAiProject, Guid>
|
||||
{
|
||||
//
|
||||
var result = new XMongoRepositoryDescriptor<
|
||||
XAiProject,
|
||||
Guid,
|
||||
IXAiProjectKeyGenerator,
|
||||
XAiProjectKeyGenerator,
|
||||
IXAiProjectRepositoryEvents,
|
||||
XAiProjectRepositoryEvents,
|
||||
XAiProjectGraphType,
|
||||
GuidGraphType,
|
||||
XAiProjectGraphQuery,
|
||||
IXAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphSchema,
|
||||
IXAiProjectRepository,
|
||||
XAiProjectMongoRepository,
|
||||
IXAiProjectSeeder,
|
||||
TSeederImplementation
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region InMemory Repository Descriptor Provider(s) ...
|
||||
public static XInMemoryRepositoryDescriptor<
|
||||
XAiProject,
|
||||
Guid,
|
||||
IXAiProjectKeyGenerator,
|
||||
XAiProjectKeyGenerator,
|
||||
IXAiProjectRepositoryEvents,
|
||||
XAiProjectRepositoryEvents,
|
||||
XAiProjectGraphType,
|
||||
GuidGraphType,
|
||||
XAiProjectGraphQuery,
|
||||
IXAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphSchema,
|
||||
IXAiProjectRepository,
|
||||
XAiProjectInMemoryRepository
|
||||
> GetXAiProjectInMemoryRepositoryDescriptor()
|
||||
{
|
||||
//
|
||||
var result = new XInMemoryRepositoryDescriptor<
|
||||
XAiProject,
|
||||
Guid,
|
||||
IXAiProjectKeyGenerator,
|
||||
XAiProjectKeyGenerator,
|
||||
IXAiProjectRepositoryEvents,
|
||||
XAiProjectRepositoryEvents,
|
||||
XAiProjectGraphType,
|
||||
GuidGraphType,
|
||||
XAiProjectGraphQuery,
|
||||
IXAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphSchema,
|
||||
IXAiProjectRepository,
|
||||
XAiProjectInMemoryRepository
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public static XInMemoryRepositoryDescriptor<
|
||||
XAiProject,
|
||||
Guid,
|
||||
IXAiProjectKeyGenerator,
|
||||
XAiProjectKeyGenerator,
|
||||
IXAiProjectRepositoryEvents,
|
||||
XAiProjectRepositoryEvents,
|
||||
XAiProjectGraphType,
|
||||
GuidGraphType,
|
||||
XAiProjectGraphQuery,
|
||||
IXAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphSchema,
|
||||
IXAiProjectRepository,
|
||||
XAiProjectInMemoryRepository,
|
||||
IXAiProjectSeeder,
|
||||
TSeederImplementation
|
||||
> GetXAiProjectInMemoryRepositoryDescriptor<TSeederImplementation>()
|
||||
where TSeederImplementation : XBaseDbSeeder<XAiProject, Guid>
|
||||
{
|
||||
//
|
||||
var result = new XInMemoryRepositoryDescriptor<
|
||||
XAiProject,
|
||||
Guid,
|
||||
IXAiProjectKeyGenerator,
|
||||
XAiProjectKeyGenerator,
|
||||
IXAiProjectRepositoryEvents,
|
||||
XAiProjectRepositoryEvents,
|
||||
XAiProjectGraphType,
|
||||
GuidGraphType,
|
||||
XAiProjectGraphQuery,
|
||||
IXAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphQLTypeHelper,
|
||||
XAiProjectGraphSchema,
|
||||
IXAiProjectRepository,
|
||||
XAiProjectInMemoryRepository,
|
||||
IXAiProjectSeeder,
|
||||
TSeederImplementation
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xPushService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiConversationEntityHub : IXBaseEntityHub<XAiConversation, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiConversationGraphQLTypeHelper : IXBaseGraphQLTypeHelper<XAiConversation, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiConversationKeyGenerator : IXKeyGenerator<XAiConversation, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiConversationRepository : IXBaseRepository<XAiConversation, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiConversationRepositoryEvents : IXBaseRepositoryEvents<XAiConversation>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xAiModels.Providers.Entities;
|
||||
using xPushService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiConversationRepositoryProvider : IXBaseEntityProvider<XAiConversation, Guid, XAiConversationEntityHub>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiConversationSeeder : IXBaseDbSeeder<XAiConversation, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xPushService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiMessageEntityHub : IXBaseEntityHub<XAiMessage, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiMessageGraphQLTypeHelper : IXBaseGraphQLTypeHelper<XAiMessage, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiMessageKeyGenerator : IXKeyGenerator<XAiMessage, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiMessageRepository : IXBaseRepository<XAiMessage, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiMessageRepositoryEvents : IXBaseRepositoryEvents<XAiMessage>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xAiModels.Providers.Entities;
|
||||
using xPushService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiMessageRepositoryProvider : IXBaseEntityProvider<XAiMessage, Guid, XAiMessageEntityHub>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiMessageSeeder : IXBaseDbSeeder<XAiMessage, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xPushService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiProjectEntityHub : IXBaseEntityHub<XAiProject, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiProjectGraphQLTypeHelper : IXBaseGraphQLTypeHelper<XAiProject, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiProjectKeyGenerator : IXKeyGenerator<XAiProject, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiProjectRepository : IXBaseRepository<XAiProject, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiProjectRepositoryEvents : IXBaseRepositoryEvents<XAiProject>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xAiModels.Providers.Entities;
|
||||
using xPushService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiProjectRepositoryProvider : IXBaseEntityProvider<XAiProject, Guid, XAiProjectEntityHub>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiProjectSeeder : IXBaseDbSeeder<XAiProject, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
using xStringService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces
|
||||
{
|
||||
public interface IXAiConversationTitleResourceProvider : IXItemResourceProvider
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
using xStringService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces
|
||||
{
|
||||
public interface IXAiProjectDescriptionResourceProvider : IXItemResourceProvider
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
using xStringService.Interfaces;
|
||||
|
||||
namespace xAiModels.Interfaces
|
||||
{
|
||||
public interface IXAiProjectTitleResourceProvider : IXItemResourceProvider
|
||||
{ }
|
||||
}
|
||||
@@ -1,19 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using xModels.Base;
|
||||
using xModels.Dtos;
|
||||
|
||||
namespace xAiModels.Models
|
||||
namespace xAiModels.Models.Dtos
|
||||
{
|
||||
/// <summary>
|
||||
/// Conversation Describe ...
|
||||
/// </summary>
|
||||
public class XAiConversationDto : XBaseDto
|
||||
public class XAiConversationDto : XBaseGuidIDEntityDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Id of Conversation ...
|
||||
/// User Identifier ...
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
/// <value></value>
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Owner Info ...
|
||||
/// </summary>
|
||||
public virtual XPersonDto Owner { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Title of Conversation ...
|
||||
@@ -30,26 +35,12 @@ namespace xAiModels.Models
|
||||
/// </summary>
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Messages of Conversation ...
|
||||
/// </summary>
|
||||
public IEnumerable<XAiMessageDto> Messages { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User Identifier ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public string OwnerId { get; set; }
|
||||
public XPersonDto Owner { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Project ID ...
|
||||
/// </summary>
|
||||
public Guid ProjectId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Project ...
|
||||
/// </summary>
|
||||
public XAiProjectDto Project { get; set; }
|
||||
public Guid ProjectId { get; set; }
|
||||
|
||||
public virtual string ProjectTitle { get; set; } = null;
|
||||
public virtual string ProjectDescription { get; set; } = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using xAiModels.Constants;
|
||||
using xCommons.Extensions;
|
||||
using xModels.Base;
|
||||
using xModels.Dtos;
|
||||
|
||||
namespace xAiModels.Models.Dtos
|
||||
{
|
||||
public class XAiMessageDto : XBaseGuidIDEntityDto
|
||||
{
|
||||
/// <summary>
|
||||
/// User Identifier ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Owner Info ...
|
||||
/// </summary>
|
||||
public virtual XPersonDto Owner { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Message of Chat ...
|
||||
/// </summary>
|
||||
public string Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Role of Message ...
|
||||
/// </summary>
|
||||
public XAiChatRole Role { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Created Time ...
|
||||
/// </summary>
|
||||
public DateTime CreatedOn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Updated Time ...
|
||||
/// </summary>
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Conversation Id ...
|
||||
/// </summary>
|
||||
public Guid ConversationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Conversation Info ...
|
||||
/// </summary>
|
||||
public virtual XAiConversationDto Conversation { get; set; } = null;
|
||||
|
||||
//
|
||||
#region Meta Data Property ...
|
||||
private string _metadata;
|
||||
|
||||
/// <summary>
|
||||
/// Meta Data of Message ...
|
||||
/// </summary>
|
||||
public IDictionary<string, object> Metadata { get; private set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Meta Data of MEssage in Json ...
|
||||
/// </summary>
|
||||
public string MeatDatas
|
||||
{
|
||||
//
|
||||
get => _metadata;
|
||||
|
||||
//
|
||||
set
|
||||
{
|
||||
//
|
||||
// Converts Json String to Dictionary ...
|
||||
if (!value.IsNullOrEmpty())
|
||||
{
|
||||
Metadata = value.FromJSON<IDictionary<string, object>>();
|
||||
}
|
||||
|
||||
//
|
||||
_metadata = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -3,17 +3,23 @@ using System.Collections.Generic;
|
||||
using xModels.Base;
|
||||
using xModels.Dtos;
|
||||
|
||||
namespace xAiModels.Models
|
||||
namespace xAiModels.Models.Dtos
|
||||
{
|
||||
/// <summary>
|
||||
/// an Ai Project is a Conceptual Separation of AI Conversations ...
|
||||
/// Describe a Project ...
|
||||
/// </summary>
|
||||
public class XAiProjectDto : XBaseDto
|
||||
public class XAiProjectDto : XBaseGuidIDEntityDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Id of Project ...
|
||||
/// User Identifier ...
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
/// <value></value>
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Owner Info ...
|
||||
/// </summary>
|
||||
public virtual XPersonDto Owner { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Title of Project ...
|
||||
@@ -40,16 +46,9 @@ namespace xAiModels.Models
|
||||
/// </summary>
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User Identifier ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public string OwnerId { get; set; }
|
||||
public XPersonDto Owner { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Conversations ...
|
||||
/// </summary>
|
||||
public IEnumerable<XAiConversationDto> Conversations { get; set; }
|
||||
public virtual IList<XAiConversationDto> Conversations { get; set; } = [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using xModels.Base;
|
||||
|
||||
namespace xAiModels.Models.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Conversation Describe ...
|
||||
/// </summary>
|
||||
public class XAiConversation : XBaseGuidIDEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// User Identifier ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[StringLength(255)]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Title of Conversation ...
|
||||
/// </summary>
|
||||
[Required]
|
||||
[StringLength(255)]
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Created Time ...
|
||||
/// </summary>
|
||||
public DateTime CreatedOn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Updated Time ...
|
||||
/// </summary>
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Project ID ...
|
||||
/// </summary>
|
||||
[Required]
|
||||
public Guid ProjectId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using xAiModels.Constants;
|
||||
using xCommons.Extensions;
|
||||
using xModels.Base;
|
||||
|
||||
namespace xAiModels.Models.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Message Model of Ai ...
|
||||
/// </summary>
|
||||
public class XAiMessage : XBaseGuidIDEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// User Identifier ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[StringLength(255)]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Message of Chat ...
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Role of Message ...
|
||||
/// </summary>
|
||||
public XAiChatRole Role { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Created Time ...
|
||||
/// </summary>
|
||||
public DateTime CreatedOn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Updated Time ...
|
||||
/// </summary>
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Conversation Id ...
|
||||
/// </summary>
|
||||
[StringLength(255)]
|
||||
public Guid ConversationId { get; set; }
|
||||
|
||||
//
|
||||
#region Meta Data Property ...
|
||||
private string _metadata;
|
||||
|
||||
/// <summary>
|
||||
/// Meta Data of Message ...
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public IDictionary<string, object> Metadata { get; private set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Meta Data of MEssage in Json ...
|
||||
/// </summary>
|
||||
public string MeatDatas
|
||||
{
|
||||
//
|
||||
get => _metadata;
|
||||
|
||||
//
|
||||
set
|
||||
{
|
||||
//
|
||||
// Converts Json String to Dictionary ...
|
||||
if (!value.IsNullOrEmpty())
|
||||
{
|
||||
Metadata = value.FromJSON<IDictionary<string, object>>();
|
||||
}
|
||||
|
||||
//
|
||||
_metadata = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using xModels.Base;
|
||||
|
||||
namespace xAiModels.Models.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Describe a Project ...
|
||||
/// </summary>
|
||||
public class XAiProject : XBaseGuidIDEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// User Identifier ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[StringLength(255)]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Title of Project ...
|
||||
/// </summary>
|
||||
[Required]
|
||||
[StringLength(255)]
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Description of Project ...
|
||||
/// </summary>
|
||||
[StringLength(1000)]
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// a Prompt for Project Start ...
|
||||
/// </summary>
|
||||
public string Prompt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Created Time ...
|
||||
/// </summary>
|
||||
public DateTime CreatedOn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Updated Time ...
|
||||
/// </summary>
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
using System;
|
||||
using xAiModels.Constants;
|
||||
using xModels.Base;
|
||||
using xModels.Dtos;
|
||||
|
||||
namespace xAiModels.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Message Model of Ai ...
|
||||
/// </summary>
|
||||
public class XAiMessageDto : XBaseDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Id of Message ...
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Message of Chat ...
|
||||
/// </summary>
|
||||
public string Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Role of Message ...
|
||||
/// </summary>
|
||||
public XAiChatRole Role { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Created Time ...
|
||||
/// </summary>
|
||||
public DateTime CreatedOn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Updated Time ...
|
||||
/// </summary>
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User Identifier ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public string OwnerId { get; set; }
|
||||
public XPersonDto Owner { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Conversation Id ...
|
||||
/// </summary>
|
||||
public Guid ConversationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Conversation ...
|
||||
/// </summary>
|
||||
public XAiConversationDto Conversation { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
using System;
|
||||
using xAiModels.Constants;
|
||||
using xModels.Base;
|
||||
|
||||
namespace xAiModels.Models
|
||||
{
|
||||
public class XAiMessageUpdateDto : XBaseDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Message Sequence ...
|
||||
/// </summary>
|
||||
public long Sequense { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Id of Message ...
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Message of Chat ...
|
||||
/// </summary>
|
||||
public string Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Role of Message ...
|
||||
/// </summary>
|
||||
public XAiChatRole Role { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Updated Time ...
|
||||
/// </summary>
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User Identifier ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Conversation Id ...
|
||||
/// </summary>
|
||||
public Guid ConversationId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Db;
|
||||
using xDataService.Interfaces;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiConversationEFRepository<TContext> : XBaseEFRepository<XAiConversation, Guid, TContext>, IXAiConversationRepository
|
||||
where TContext : XDbContext
|
||||
{
|
||||
public XAiConversationEFRepository(
|
||||
IXUnitOfWorks<TContext> unitOfWorks,
|
||||
XDataServiceConfiguration configuration,
|
||||
IXAiConversationKeyGenerator keyGenerator = null,
|
||||
IXAiConversationRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
unitOfWorks,
|
||||
configuration,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiConversationEntityHub : XBaseEntityHub<XAiConversation, Guid>, IXAiConversationEntityHub
|
||||
{
|
||||
public XAiConversationEntityHub(
|
||||
ILogger<XAiConversationEntityHub> logger
|
||||
) : base(logger)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiConversationInMemoryRepository : XBaseInMemoryRepository<XAiConversation, Guid>, IXAiConversationRepository
|
||||
{
|
||||
public XAiConversationInMemoryRepository(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXAiConversationKeyGenerator keyGenerator = null,
|
||||
IXAiConversationRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
configuration,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiConversationKeyGenerator : XGuidKeyGenerator<XAiConversation>, IXAiConversationKeyGenerator
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiConversationMongoRepository : XBaseMongoRepository<XAiConversation, Guid>, IXAiConversationRepository
|
||||
{
|
||||
public XAiConversationMongoRepository(
|
||||
XDataBaseConfiguration dbConfiguration,
|
||||
XDataServiceConfiguration configuration,
|
||||
string collectionName = null,
|
||||
IXAiConversationKeyGenerator keyGenerator = null,
|
||||
IXAiConversationRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
dbConfiguration,
|
||||
configuration,
|
||||
collectionName,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiConversationRepositoryEvents : XBaseRepositoryEvents<XAiConversation>, IXAiConversationRepositoryEvents
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xIdentityService.Interfaces;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiConversationRepositoryProvider : XBaseEntityProvider<XAiConversation, Guid, XAiConversationEntityHub>, IXAiConversationRepositoryProvider
|
||||
{
|
||||
public XAiConversationRepositoryProvider(
|
||||
IHubContext<XAiConversationEntityHub> hub,
|
||||
IXAiConversationRepository repository,
|
||||
XDataServiceConfiguration dataConfiguration,
|
||||
IXIdentityProvider identityProvider = null
|
||||
) : base(
|
||||
hub,
|
||||
repository,
|
||||
dataConfiguration,
|
||||
identityProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public abstract class XAiConversationSeederBase : XBaseDbSeeder<XAiConversation, Guid>, IXAiConversationSeeder
|
||||
{
|
||||
protected XAiConversationSeederBase(
|
||||
string entity,
|
||||
string database,
|
||||
IXAiConversationRepository repository,
|
||||
XDataServiceConfiguration dataServiceConfiguration
|
||||
) : base(
|
||||
entity,
|
||||
database,
|
||||
repository,
|
||||
dataServiceConfiguration
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Db;
|
||||
using xDataService.Interfaces;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiMessageEFRepository<TContext> : XBaseEFRepository<XAiMessage, Guid, TContext>, IXAiMessageRepository
|
||||
where TContext : XDbContext
|
||||
{
|
||||
public XAiMessageEFRepository(
|
||||
IXUnitOfWorks<TContext> unitOfWorks,
|
||||
XDataServiceConfiguration configuration,
|
||||
IXAiMessageKeyGenerator keyGenerator = null,
|
||||
IXAiMessageRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
unitOfWorks,
|
||||
configuration,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiMessageEntityHub : XBaseEntityHub<XAiMessage, Guid>, IXAiMessageEntityHub
|
||||
{
|
||||
public XAiMessageEntityHub(
|
||||
ILogger<XAiMessageEntityHub> logger
|
||||
) : base(logger)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiMessageInMemoryRepository : XBaseInMemoryRepository<XAiMessage, Guid>, IXAiMessageRepository
|
||||
{
|
||||
public XAiMessageInMemoryRepository(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXAiMessageKeyGenerator keyGenerator = null,
|
||||
IXAiMessageRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
configuration,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiMessageKeyGenerator : XGuidKeyGenerator<XAiMessage>, IXAiMessageKeyGenerator
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiMessageMongoRepository : XBaseMongoRepository<XAiMessage, Guid>, IXAiMessageRepository
|
||||
{
|
||||
public XAiMessageMongoRepository(
|
||||
XDataBaseConfiguration dbConfiguration,
|
||||
XDataServiceConfiguration configuration,
|
||||
string collectionName = null,
|
||||
IXAiMessageKeyGenerator keyGenerator = null,
|
||||
IXAiMessageRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
dbConfiguration,
|
||||
configuration,
|
||||
collectionName,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiMessageRepositoryEvents : XBaseRepositoryEvents<XAiMessage>, IXAiMessageRepositoryEvents
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xIdentityService.Interfaces;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiMessageRepositoryProvider : XBaseEntityProvider<XAiMessage, Guid, XAiMessageEntityHub>, IXAiMessageRepositoryProvider
|
||||
{
|
||||
public XAiMessageRepositoryProvider(
|
||||
IHubContext<XAiMessageEntityHub> hub,
|
||||
IXAiMessageRepository repository,
|
||||
XDataServiceConfiguration dataConfiguration,
|
||||
IXIdentityProvider identityProvider = null
|
||||
) : base(
|
||||
hub,
|
||||
repository,
|
||||
dataConfiguration,
|
||||
identityProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public abstract class XAiMessageSeederBase : XBaseDbSeeder<XAiMessage, Guid>, IXAiMessageSeeder
|
||||
{
|
||||
protected XAiMessageSeederBase(
|
||||
string entity,
|
||||
string database,
|
||||
IXAiMessageRepository repository,
|
||||
XDataServiceConfiguration dataServiceConfiguration
|
||||
) : base(
|
||||
entity,
|
||||
database,
|
||||
repository,
|
||||
dataServiceConfiguration
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Db;
|
||||
using xDataService.Interfaces;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiProjectEFRepository<TContext> : XBaseEFRepository<XAiProject, Guid, TContext>, IXAiProjectRepository
|
||||
where TContext : XDbContext
|
||||
{
|
||||
public XAiProjectEFRepository(
|
||||
IXUnitOfWorks<TContext> unitOfWorks,
|
||||
XDataServiceConfiguration configuration,
|
||||
IXAiProjectKeyGenerator keyGenerator = null,
|
||||
IXAiProjectRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
unitOfWorks,
|
||||
configuration,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiProjectEntityHub : XBaseEntityHub<XAiProject, Guid>, IXAiProjectEntityHub
|
||||
{
|
||||
public XAiProjectEntityHub(
|
||||
ILogger<XAiProjectEntityHub> logger
|
||||
) : base(logger)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiProjectInMemoryRepository : XBaseInMemoryRepository<XAiProject, Guid>, IXAiProjectRepository
|
||||
{
|
||||
public XAiProjectInMemoryRepository(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXAiProjectKeyGenerator keyGenerator = null,
|
||||
IXAiProjectRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
configuration,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiProjectKeyGenerator : XGuidKeyGenerator<XAiProject>, IXAiProjectKeyGenerator
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiProjectMongoRepository : XBaseMongoRepository<XAiProject, Guid>, IXAiProjectRepository
|
||||
{
|
||||
public XAiProjectMongoRepository(
|
||||
XDataBaseConfiguration dbConfiguration,
|
||||
XDataServiceConfiguration configuration,
|
||||
string collectionName = null,
|
||||
IXAiProjectKeyGenerator keyGenerator = null,
|
||||
IXAiProjectRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
dbConfiguration,
|
||||
configuration,
|
||||
collectionName,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiProjectRepositoryEvents : XBaseRepositoryEvents<XAiProject>, IXAiProjectRepositoryEvents
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xIdentityService.Interfaces;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public class XAiProjectRepositoryProvider : XBaseEntityProvider<XAiProject, Guid, XAiProjectEntityHub>, IXAiProjectRepositoryProvider
|
||||
{
|
||||
public XAiProjectRepositoryProvider(
|
||||
IHubContext<XAiProjectEntityHub> hub,
|
||||
IXAiProjectRepository repository,
|
||||
XDataServiceConfiguration dataConfiguration,
|
||||
IXIdentityProvider identityProvider = null
|
||||
) : base(
|
||||
hub,
|
||||
repository,
|
||||
dataConfiguration,
|
||||
identityProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public abstract class XAiProjectSeederBase : XBaseDbSeeder<XAiProject, Guid>, IXAiProjectSeeder
|
||||
{
|
||||
protected XAiProjectSeederBase(
|
||||
string entity,
|
||||
string database,
|
||||
IXAiProjectRepository repository,
|
||||
XDataServiceConfiguration dataServiceConfiguration
|
||||
) : base(
|
||||
entity,
|
||||
database,
|
||||
repository,
|
||||
dataServiceConfiguration
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using xAiModels.Constants;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xAiModels.Providers.GraphQL
|
||||
{
|
||||
public class XAiConversationGraphQLTypeHelper : XBaseGraphQLTypeHelper<XAiConversation, Guid>, IXAiConversationGraphQLTypeHelper
|
||||
{
|
||||
public override string GetInQueryCollectionName()
|
||||
{
|
||||
return XAiModelsConstants.XAiConversationCollectionName;
|
||||
}
|
||||
|
||||
public override string GetInQuerySingleName()
|
||||
{
|
||||
return XAiModelsConstants.XAiConversationSignleName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xAiModels.Providers.GraphQL
|
||||
{
|
||||
public class XAiConversationGraphQuery : XBaseGraphQLQuery<XAiConversation, Guid, XAiConversationGraphType, GuidGraphType>
|
||||
{
|
||||
public XAiConversationGraphQuery(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXAiConversationRepository repository,
|
||||
IXAiConversationGraphQLTypeHelper helper
|
||||
) : base(
|
||||
configuration,
|
||||
repository,
|
||||
helper
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
|
||||
namespace xAiModels.Providers.GraphQL
|
||||
{
|
||||
public class XAiConversationGraphSchema : Schema
|
||||
{
|
||||
public XAiConversationGraphSchema(IServiceProvider services) : base(services)
|
||||
{
|
||||
Query = (XAiConversationGraphQuery)services.GetService(typeof(XAiConversationGraphQuery));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xAiModels.Providers.GraphQL
|
||||
{
|
||||
public class XAiConversationGraphType : XBaseGraphObjectType<XAiConversation, Guid>
|
||||
{
|
||||
public XAiConversationGraphType() : base()
|
||||
{
|
||||
Field(x => x.Title);
|
||||
Field(x => x.OwnerId);
|
||||
Field(x => x.CreatedOn);
|
||||
Field(x => x.UpdatedAt);
|
||||
Field(x => x.ProjectId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using xAiModels.Constants;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xAiModels.Providers.GraphQL
|
||||
{
|
||||
public class XAiMessageGraphQLTypeHelper : XBaseGraphQLTypeHelper<XAiMessage, Guid>, IXAiMessageGraphQLTypeHelper
|
||||
{
|
||||
public override string GetInQueryCollectionName()
|
||||
{
|
||||
return XAiModelsConstants.XAiMessageCollectionName;
|
||||
}
|
||||
|
||||
public override string GetInQuerySingleName()
|
||||
{
|
||||
return XAiModelsConstants.XAiMessageSingleName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xAiModels.Providers.GraphQL
|
||||
{
|
||||
public class XAiMessageGraphQuery : XBaseGraphQLQuery<XAiMessage, Guid, XAiMessageGraphType, GuidGraphType>
|
||||
{
|
||||
public XAiMessageGraphQuery(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXAiMessageRepository repository,
|
||||
IXAiMessageGraphQLTypeHelper helper
|
||||
) : base(
|
||||
configuration,
|
||||
repository,
|
||||
helper
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
|
||||
namespace xAiModels.Providers.GraphQL
|
||||
{
|
||||
public class XAiMessageGraphSchema : Schema
|
||||
{
|
||||
public XAiMessageGraphSchema(IServiceProvider services) : base(services)
|
||||
{
|
||||
Query = (XAiMessageGraphQuery)services.GetService(typeof(XAiMessageGraphQuery));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xAiModels.Providers.GraphQL
|
||||
{
|
||||
public class XAiMessageGraphType: XBaseGraphObjectType<XAiMessage, Guid>
|
||||
{
|
||||
public XAiMessageGraphType() : base()
|
||||
{
|
||||
Field(x => x.Role);
|
||||
Field(x => x.OwnerId);
|
||||
Field(x => x.Content);
|
||||
Field(x => x.Metadata);
|
||||
Field(x => x.CreatedOn);
|
||||
Field(x => x.UpdatedAt);
|
||||
Field(x => x.ConversationId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using xAiModels.Constants;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xAiModels.Providers.GraphQL
|
||||
{
|
||||
public class XAiProjectGraphQLTypeHelper : XBaseGraphQLTypeHelper<XAiProject, Guid>, IXAiProjectGraphQLTypeHelper
|
||||
{
|
||||
public override string GetInQueryCollectionName()
|
||||
{
|
||||
return XAiModelsConstants.XAiProjectCollectionName;
|
||||
}
|
||||
|
||||
public override string GetInQuerySingleName()
|
||||
{
|
||||
return XAiModelsConstants.XAiProjectSingleName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xAiModels.Providers.GraphQL
|
||||
{
|
||||
public class XAiProjectGraphQuery : XBaseGraphQLQuery<XAiProject, Guid, XAiProjectGraphType, GuidGraphType>
|
||||
{
|
||||
public XAiProjectGraphQuery(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXAiProjectRepository repository,
|
||||
IXAiProjectGraphQLTypeHelper helper
|
||||
) : base(
|
||||
configuration,
|
||||
repository,
|
||||
helper
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
|
||||
namespace xAiModels.Providers.GraphQL
|
||||
{
|
||||
public class XAiProjectGraphSchema : Schema
|
||||
{
|
||||
public XAiProjectGraphSchema(IServiceProvider services) : base(services)
|
||||
{
|
||||
Query = (XAiProjectGraphQuery)services.GetService(typeof(XAiProjectGraphQuery));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xAiModels.Providers.GraphQL
|
||||
{
|
||||
public class XAiProjectGraphType : XBaseGraphObjectType<XAiProject, Guid>
|
||||
{
|
||||
public XAiProjectGraphType() : base()
|
||||
{
|
||||
Field(x => x.Title);
|
||||
Field(x => x.OwnerId);
|
||||
Field(x => x.Prompt);
|
||||
Field(x => x.CreatedOn);
|
||||
Field(x => x.UpdatedAt);
|
||||
Field(x => x.Description);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using xAiModels.Configurations.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers
|
||||
{
|
||||
public class XAiConversationEntityRegisterar : XBaseEntityRegisterar, IXEntityRegisterar
|
||||
{
|
||||
public XAiConversationEntityRegisterar()
|
||||
: base(nameof(XAiConversationEntityRegisterar))
|
||||
{
|
||||
//
|
||||
// Add Entity ...
|
||||
AddEntity<XAiConversation, Guid>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configure Entities ...
|
||||
/// </summary>
|
||||
/// <param name="modelBuilder"></param>
|
||||
public override void ConfigureEntities(ModelBuilder modelBuilder)
|
||||
{
|
||||
//
|
||||
// Configure Entity Using Provided ...
|
||||
modelBuilder
|
||||
.ApplyConfigurationsFromAssembly(typeof(XAiConversationEntityConfiguration).Assembly);
|
||||
|
||||
//
|
||||
base.ConfigureEntities(modelBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using xAiModels.Constants;
|
||||
using xAiModels.Interfaces;
|
||||
using xStringService.Interfaces.Dtos;
|
||||
using xStringService.Providers;
|
||||
|
||||
namespace xAiModels.Providers
|
||||
{
|
||||
public class XAiConversationTitleResourceProvider : XBaseItemResourceProvider, IXAiConversationTitleResourceProvider
|
||||
{
|
||||
public XAiConversationTitleResourceProvider(
|
||||
IXStringServiceProvider stringProvider
|
||||
) : base(
|
||||
item: XAiModelsConstants.XAiConversationTitleIdentifier,
|
||||
stringProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using xAiModels.Configurations.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers
|
||||
{
|
||||
public class XAiMessageEntityRegisterar : XBaseEntityRegisterar, IXEntityRegisterar
|
||||
{
|
||||
public XAiMessageEntityRegisterar()
|
||||
: base(nameof(XAiMessageEntityRegisterar))
|
||||
{
|
||||
//
|
||||
// Add Entity ...
|
||||
AddEntity<XAiMessage, Guid>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configure Entities ...
|
||||
/// </summary>
|
||||
/// <param name="modelBuilder"></param>
|
||||
public override void ConfigureEntities(ModelBuilder modelBuilder)
|
||||
{
|
||||
//
|
||||
// Configure Entity Using Provided ...
|
||||
modelBuilder
|
||||
.ApplyConfigurationsFromAssembly(typeof(XAiMessageEntityConfiguration).Assembly);
|
||||
|
||||
//
|
||||
base.ConfigureEntities(modelBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using xAiModels.Constants;
|
||||
using xAiModels.Interfaces;
|
||||
using xStringService.Interfaces.Dtos;
|
||||
using xStringService.Providers;
|
||||
|
||||
namespace xAiModels.Providers
|
||||
{
|
||||
public class XAiProjectDescriptionResourceProvider : XBaseItemResourceProvider, IXAiProjectDescriptionResourceProvider
|
||||
{
|
||||
public XAiProjectDescriptionResourceProvider(
|
||||
IXStringServiceProvider stringProvider
|
||||
) : base(
|
||||
item: XAiModelsConstants.XAiProjectDescriptionIdentifier,
|
||||
stringProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using xAiModels.Configurations.Entities;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xAiModels.Providers
|
||||
{
|
||||
public class XAiProjectEntityRegisterar : XBaseEntityRegisterar, IXEntityRegisterar
|
||||
{
|
||||
public XAiProjectEntityRegisterar()
|
||||
: base(nameof(XAiProjectEntityRegisterar))
|
||||
{
|
||||
//
|
||||
// Add Entity ...
|
||||
AddEntity<XAiProject, Guid>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configure Entities ...
|
||||
/// </summary>
|
||||
/// <param name="modelBuilder"></param>
|
||||
public override void ConfigureEntities(ModelBuilder modelBuilder)
|
||||
{
|
||||
//
|
||||
// Configure Entity Using Provided ...
|
||||
modelBuilder
|
||||
.ApplyConfigurationsFromAssembly(typeof(XAiProjectEntityConfiguration).Assembly);
|
||||
|
||||
//
|
||||
base.ConfigureEntities(modelBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using xAiModels.Constants;
|
||||
using xAiModels.Interfaces;
|
||||
using xStringService.Interfaces.Dtos;
|
||||
using xStringService.Providers;
|
||||
|
||||
namespace xAiModels.Providers
|
||||
{
|
||||
public class XAiProjectTitleResourceProvider : XBaseItemResourceProvider, IXAiProjectTitleResourceProvider
|
||||
{
|
||||
public XAiProjectTitleResourceProvider(
|
||||
IXStringServiceProvider stringProvider
|
||||
) : base(
|
||||
item: XAiModelsConstants.XAiProjectTitleIdentifier,
|
||||
stringProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -3,6 +3,6 @@
|
||||
<packageSources>
|
||||
<!-- <add key="megan" value="https://hub.megan.ir/nuget/index.json" /> -->
|
||||
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||
<add key="baget" value="https://nuget.saherelmhub.ir/v3/index.json" protocolVersion="3" />
|
||||
<add key="baget" value="https://nuget.saherelmhub.ir/v3/index.json" protocolVersion="3" disableTLSCertificateValidation="true" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
+23
-9
@@ -1,13 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<!-- Runtime Definition -->
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<PackageId>xSaherelm.xAiModels</PackageId>
|
||||
<Version>1.0.0</Version>
|
||||
<LangVersion>12.0</LangVersion>
|
||||
<Authors>Hadi Khazaee Asl</Authors>
|
||||
<Company>SaherElm IT Center</Company>
|
||||
<PackageId>xSaherelm.xAiModels</PackageId>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
|
||||
<Description>
|
||||
it is a Part of xSaherElm project which Provides all Models which used in Ai Service ...
|
||||
it is a Part of xSaherElm project which Provides all Models and Data Service
|
||||
Implementations which used in Ai Service ...
|
||||
</Description>
|
||||
|
||||
<!-- Icon Definition -->
|
||||
@@ -22,14 +26,24 @@
|
||||
|
||||
<!-- Local Modules -->
|
||||
<ItemGroup>
|
||||
<!-- <PackageReference Include="xDashboard.xModels" Version="1.0.0" /> -->
|
||||
<PackageReference Include="Microsoft.Extensions.AI" Version="10.4.1" />
|
||||
<!-- <PackageReference Include="xDashboard.xCommons" Version="1.0.0" /> -->
|
||||
<!-- <PackageReference Include="xDashboard.xStringService" Version="1.0.0" /> -->
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Project Dependencies -->
|
||||
<!-- Local Dependencies -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\xModels\xModels.csproj" />
|
||||
<ProjectReference Include="..\xCommons\xCommons.csproj" />
|
||||
<ProjectReference Include="../xStringService/xStringService.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Dependencies -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.AI" Version="10.4.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- For XML Documentation Support -->
|
||||
<PropertyGroup>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<NoWarn>$(NoWarn);1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user