fix usage of Enrichers and Dto Structures ...
This commit is contained in:
@@ -6,7 +6,6 @@ using xAiModels.Interfaces;
|
||||
using xAiModels.Interfaces.Dtos;
|
||||
using xAiModels.Interfaces.Enrichers;
|
||||
using xAiModels.Models.Dtos;
|
||||
using xAiModels.Models.Entities;
|
||||
using xCommons.Extensions;
|
||||
using xIdentityService.Interfaces;
|
||||
using xIdentityService.Extensions;
|
||||
@@ -58,14 +57,14 @@ namespace xAiModels.Providers.Enrichers
|
||||
//
|
||||
// Attached Resolved Info to Destination ...
|
||||
destination.Owner = ownerTask.Result;
|
||||
destination.TitleLocales = titleLocalesTask.Result;
|
||||
destination.TitleResource = titleLocalesTask.Result;
|
||||
var project = projectTask.Result;
|
||||
if (!project.IsNullOrDefault())
|
||||
{
|
||||
destination.ProjectTitle = project.Title;
|
||||
destination.ProjectDescription = project.Description;
|
||||
destination.ProjectTitleLocales = project.TitleLocales;
|
||||
destination.ProjectDescriptionLocales = project.DescriptionLocales;
|
||||
destination.ProjectTitleResource = project.TitleResource;
|
||||
destination.ProjectDescriptionResource = project.DescriptionResource;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +75,7 @@ namespace xAiModels.Providers.Enrichers
|
||||
/// <param name="destinations"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<XAiConversationDto>> EnrichRangeAsync(
|
||||
public async Task EnrichRangeAsync(
|
||||
IEnumerable<XAiConversationDto> sources,
|
||||
IEnumerable<XAiConversationDto> destinations,
|
||||
CancellationToken cancellationToken = default
|
||||
@@ -90,9 +89,6 @@ namespace xAiModels.Providers.Enrichers
|
||||
|
||||
//
|
||||
await Task.WhenAll(tasks);
|
||||
|
||||
//
|
||||
return destinations;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -137,24 +133,23 @@ namespace xAiModels.Providers.Enrichers
|
||||
/// <param name="title"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<XLocaleResourceDto[]> ResolveTitleLocalesAsync(
|
||||
private async Task<XResourceDto> ResolveTitleLocalesAsync(
|
||||
string title,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
XLocaleResourceDto[] result = [];
|
||||
XResourceDto result = null;
|
||||
if (title.IsNullOrEmpty())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
var locales = await conversationTitleResourceProvider.GetLocales(
|
||||
result = await conversationTitleResourceProvider.GetResource(
|
||||
identifier: title,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
result = [.. locales];
|
||||
|
||||
//
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user