last works ...
This commit is contained in:
@@ -1,10 +1,222 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore.Query;
|
||||
using xAiModels.Models.Dtos;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
using xModels.Dtos;
|
||||
|
||||
namespace xAiModels.Interfaces.Dtos
|
||||
{
|
||||
public interface IXAiConversationRepositoryService : IXBaseRepositoryService<XAiConversation, XAiConversationDto, Guid>
|
||||
{ }
|
||||
{
|
||||
//
|
||||
#region Actions ...
|
||||
//
|
||||
#region Add ...
|
||||
/// <summary>
|
||||
/// add a new Dto ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XAiConversationDto> AddAsync(
|
||||
XAiConversationDto item,
|
||||
bool saveChanges = true,
|
||||
bool fillMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// add or update a Dto (add if not exists/update if exists) ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XAiConversationDto> AddOrUpdateAsync(
|
||||
XAiConversationDto item,
|
||||
bool saveChanges = true,
|
||||
bool fillMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Update ...
|
||||
/// <summary>
|
||||
/// Update an Dto values ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XAiConversationDto> UpdateAsync(
|
||||
Guid id,
|
||||
XAiConversationDto item,
|
||||
bool saveChanges = true,
|
||||
bool fillMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Remove ...
|
||||
/// <summary>
|
||||
/// remove an Dto by it's Id ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="softDelete"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XAiConversationDto> RemoveAsync(
|
||||
Guid id,
|
||||
bool softDelete = false,
|
||||
bool saveChanges = true,
|
||||
bool fillMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// remove an Dto ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="softDelete"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XAiConversationDto> RemoveAsync(
|
||||
XAiConversationDto item,
|
||||
bool softDelete = false,
|
||||
bool saveChanges = true,
|
||||
bool fillMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Retrieve ...
|
||||
/// <summary>
|
||||
/// retrieve an Dto by it's Id ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="includeBuilder"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XAiConversationDto> GetAsync(
|
||||
Guid id,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Func<IQueryable<XAiConversation>, IIncludableQueryable<XAiConversation, object>> includeBuilder = null,
|
||||
bool fillMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// retrieve all exists Dtos ...
|
||||
/// </summary>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="includeBuilder"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XAiConversationDto>> GetAllAsync(
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Func<IQueryable<XAiConversation>, IOrderedQueryable<XAiConversation>> orderBuilder = null,
|
||||
Func<IQueryable<XAiConversation>, IIncludableQueryable<XAiConversation, object>> includeBuilder = null,
|
||||
bool fillMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// retrieve all exists Dtos
|
||||
/// as Async Enumerable ...
|
||||
/// </summary>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="includeBuilder"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
IAsyncEnumerable<XAiConversationDto> GetAllAsAsyncEnumerable(
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Func<IQueryable<XAiConversation>, IOrderedQueryable<XAiConversation>> orderBuilder = null,
|
||||
Func<IQueryable<XAiConversation>, IIncludableQueryable<XAiConversation, object>> includeBuilder = null,
|
||||
bool fillMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// find an Dto by providing a Conditional Expression ...
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="includeBuilder"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XAiConversationDto> FindOneAsync(
|
||||
Expression<Func<XAiConversation, bool>> predicate,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Func<IQueryable<XAiConversation>, IIncludableQueryable<XAiConversation, object>> includeBuilder = null,
|
||||
bool fillMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// find a collection of Dtos by proving a Conditional Expression ...
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="includeBuilder"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XAiConversationDto>> FindManyAsync(
|
||||
Expression<Func<XAiConversation, bool>> predicate,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Func<IQueryable<XAiConversation>, IOrderedQueryable<XAiConversation>> orderBuilder = null,
|
||||
Func<IQueryable<XAiConversation>, IIncludableQueryable<XAiConversation, object>> includeBuilder = null,
|
||||
bool fillMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// retrieve Dtos based on XQuery Pagination structure ...
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="includeBuilder"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XQueryResult<XAiConversationDto>> QueryAsync(
|
||||
XQuery query,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Expression<Func<XAiConversation, bool>> predicate = null,
|
||||
Func<IQueryable<XAiConversation>, IOrderedQueryable<XAiConversation>> orderBuilder = null,
|
||||
Func<IQueryable<XAiConversation>, IIncludableQueryable<XAiConversation, object>> includeBuilder = null,
|
||||
bool fillMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,6 @@ namespace xAiModels.Interfaces.Dtos
|
||||
{
|
||||
public interface IXAiProjectRepositoryService : IXBaseRepositoryService<XAiProject, XAiProjectDto, Guid>
|
||||
{
|
||||
|
||||
//
|
||||
#region Actions ...
|
||||
//
|
||||
@@ -25,12 +24,14 @@ namespace xAiModels.Interfaces.Dtos
|
||||
/// <param name="item"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="fillConversations"></param>
|
||||
/// <param name="fillConversationMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XAiProjectDto> AddAsync(
|
||||
XAiProjectDto item,
|
||||
bool saveChanges = true,
|
||||
bool fillConversations = true,
|
||||
bool fillConversationMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
@@ -40,12 +41,14 @@ namespace xAiModels.Interfaces.Dtos
|
||||
/// <param name="item"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="fillConversations"></param>
|
||||
/// <param name="fillConversationMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XAiProjectDto> AddOrUpdateAsync(
|
||||
XAiProjectDto item,
|
||||
bool saveChanges = true,
|
||||
bool fillConversations = true,
|
||||
bool fillConversationMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
@@ -59,6 +62,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
/// <param name="item"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="fillConversations"></param>
|
||||
/// <param name="fillConversationMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XAiProjectDto> UpdateAsync(
|
||||
@@ -66,6 +70,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
XAiProjectDto item,
|
||||
bool saveChanges = true,
|
||||
bool fillConversations = true,
|
||||
bool fillConversationMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
@@ -79,6 +84,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
/// <param name="softDelete"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="fillConversations"></param>
|
||||
/// <param name="fillConversationMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XAiProjectDto> RemoveAsync(
|
||||
@@ -86,6 +92,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
bool softDelete = false,
|
||||
bool saveChanges = true,
|
||||
bool fillConversations = true,
|
||||
bool fillConversationMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
@@ -96,6 +103,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
/// <param name="softDelete"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="fillConversations"></param>
|
||||
/// <param name="fillConversationMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XAiProjectDto> RemoveAsync(
|
||||
@@ -103,6 +111,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
bool softDelete = false,
|
||||
bool saveChanges = true,
|
||||
bool fillConversations = true,
|
||||
bool fillConversationMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
@@ -116,6 +125,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="includeBuilder"></param>
|
||||
/// <param name="fillConversations"></param>
|
||||
/// <param name="fillConversationMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XAiProjectDto> GetAsync(
|
||||
@@ -123,6 +133,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Func<IQueryable<XAiProject>, IIncludableQueryable<XAiProject, object>> includeBuilder = null,
|
||||
bool fillConversations = true,
|
||||
bool fillConversationMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
@@ -133,6 +144,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="includeBuilder"></param>
|
||||
/// <param name="fillConversations"></param>
|
||||
/// <param name="fillConversationMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XAiProjectDto>> GetAllAsync(
|
||||
@@ -140,6 +152,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
Func<IQueryable<XAiProject>, IOrderedQueryable<XAiProject>> orderBuilder = null,
|
||||
Func<IQueryable<XAiProject>, IIncludableQueryable<XAiProject, object>> includeBuilder = null,
|
||||
bool fillConversations = true,
|
||||
bool fillConversationMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
@@ -151,6 +164,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="includeBuilder"></param>
|
||||
/// <param name="fillConversations"></param>
|
||||
/// <param name="fillConversationMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
IAsyncEnumerable<XAiProjectDto> GetAllAsAsyncEnumerable(
|
||||
@@ -158,6 +172,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
Func<IQueryable<XAiProject>, IOrderedQueryable<XAiProject>> orderBuilder = null,
|
||||
Func<IQueryable<XAiProject>, IIncludableQueryable<XAiProject, object>> includeBuilder = null,
|
||||
bool fillConversations = true,
|
||||
bool fillConversationMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
@@ -168,6 +183,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="includeBuilder"></param>
|
||||
/// <param name="fillConversations"></param>
|
||||
/// <param name="fillConversationMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XAiProjectDto> FindOneAsync(
|
||||
@@ -175,6 +191,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Func<IQueryable<XAiProject>, IIncludableQueryable<XAiProject, object>> includeBuilder = null,
|
||||
bool fillConversations = true,
|
||||
bool fillConversationMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
@@ -186,6 +203,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="includeBuilder"></param>
|
||||
/// <param name="fillConversations"></param>
|
||||
/// <param name="fillConversationMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XAiProjectDto>> FindManyAsync(
|
||||
@@ -194,6 +212,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
Func<IQueryable<XAiProject>, IOrderedQueryable<XAiProject>> orderBuilder = null,
|
||||
Func<IQueryable<XAiProject>, IIncludableQueryable<XAiProject, object>> includeBuilder = null,
|
||||
bool fillConversations = true,
|
||||
bool fillConversationMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
@@ -206,6 +225,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="includeBuilder"></param>
|
||||
/// <param name="fillConversations"></param>
|
||||
/// <param name="fillConversationMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XQueryResult<XAiProjectDto>> QueryAsync(
|
||||
@@ -215,6 +235,7 @@ namespace xAiModels.Interfaces.Dtos
|
||||
Func<IQueryable<XAiProject>, IOrderedQueryable<XAiProject>> orderBuilder = null,
|
||||
Func<IQueryable<XAiProject>, IIncludableQueryable<XAiProject, object>> includeBuilder = null,
|
||||
bool fillConversations = true,
|
||||
bool fillConversationMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using xAiModels.Models.Dtos;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
@@ -7,5 +10,35 @@ namespace xAiModels.Interfaces.Enrichers
|
||||
/// Ai Conversation Enricher ...
|
||||
/// </summary>
|
||||
public interface IXAiConversationEnricher : IXBaseEnricher<XAiConversationDto, XAiConversationDto>
|
||||
{ }
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts a Signle Entity to Dto ...
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="destination"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task EnrichAsync(
|
||||
XAiConversationDto source,
|
||||
XAiConversationDto destination,
|
||||
bool fillMessages = false,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Collection of Entities to Dtos ...
|
||||
/// </summary>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="destinations"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task EnrichRangeAsync(
|
||||
IEnumerable<XAiConversationDto> sources,
|
||||
IEnumerable<XAiConversationDto> destinations,
|
||||
bool fillMessages = false,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ namespace xAiModels.Interfaces.Enrichers
|
||||
XAiProjectDto source,
|
||||
XAiProjectDto destination,
|
||||
bool fillConversations = true,
|
||||
bool fillConversationMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
@@ -20,6 +21,7 @@ namespace xAiModels.Interfaces.Enrichers
|
||||
IEnumerable<XAiProjectDto> sources,
|
||||
IEnumerable<XAiProjectDto> destinations,
|
||||
bool fillConversations = true,
|
||||
bool fillConversationMessages = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user