last ...
This commit is contained in:
@@ -1,10 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
|
using xAiModels.Interfaces;
|
||||||
using xAiModels.Models.Dtos;
|
using xAiModels.Models.Dtos;
|
||||||
using xAiModels.Models.Entities;
|
using xAiModels.Models.Entities;
|
||||||
|
using xIdentityService.Extensions;
|
||||||
using xIdentityService.Interfaces;
|
using xIdentityService.Interfaces;
|
||||||
|
|
||||||
namespace xAiModels.Configurations.Entities
|
namespace xAiModels.Configurations.Entities
|
||||||
@@ -12,12 +11,21 @@ namespace xAiModels.Configurations.Entities
|
|||||||
public class XAiConversationMappingAction : IMappingAction<XAiConversation, XAiConversationDto>
|
public class XAiConversationMappingAction : IMappingAction<XAiConversation, XAiConversationDto>
|
||||||
{
|
{
|
||||||
private readonly IXIdentityProvider identityProvider;
|
private readonly IXIdentityProvider identityProvider;
|
||||||
|
private readonly IXAiProjectTitleResourceProvider projectTitleResourceProvider;
|
||||||
|
private readonly IXAiConversationTitleResourceProvider conversationTitleResourceProvider;
|
||||||
|
private readonly IXAiProjectDescriptionResourceProvider projectDescriptionResourceProvider;
|
||||||
|
|
||||||
public XAiConversationMappingAction(
|
public XAiConversationMappingAction(
|
||||||
IXIdentityProvider identityProvider
|
IXIdentityProvider identityProvider,
|
||||||
|
IXAiProjectTitleResourceProvider projectTitleResourceProvider,
|
||||||
|
IXAiConversationTitleResourceProvider conversationTitleResourceProvider,
|
||||||
|
IXAiProjectDescriptionResourceProvider projectDescriptionResourceProvider
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.identityProvider = identityProvider;
|
this.identityProvider = identityProvider;
|
||||||
|
this.projectTitleResourceProvider = projectTitleResourceProvider;
|
||||||
|
this.conversationTitleResourceProvider = conversationTitleResourceProvider;
|
||||||
|
this.projectDescriptionResourceProvider = projectDescriptionResourceProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Process(
|
public void Process(
|
||||||
@@ -28,6 +36,19 @@ namespace xAiModels.Configurations.Entities
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Retrieve Owner ...
|
// Retrieve Owner ...
|
||||||
|
var device = identityProvider.GetDevice();
|
||||||
|
var ownerUserInfo = identityProvider.GetUserInfo(
|
||||||
|
device: device,
|
||||||
|
userSelectByParam: source.OwnerId
|
||||||
|
)
|
||||||
|
.GetAwaiter()
|
||||||
|
.GetResult();
|
||||||
|
var owner = ownerUserInfo.ToXPersonDto();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Setting Owner ...
|
||||||
|
destination.Owner = owner;
|
||||||
|
|
||||||
// Retrieve Project Info ...
|
// Retrieve Project Info ...
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using xAiModels.Models.Dtos;
|
using xAiModels.Models.Dtos;
|
||||||
using xAiModels.Models.Entities;
|
using xAiModels.Models.Entities;
|
||||||
|
using xIdentityService.Extensions;
|
||||||
using xIdentityService.Interfaces;
|
using xIdentityService.Interfaces;
|
||||||
|
|
||||||
namespace xAiModels.Configurations.Entities
|
namespace xAiModels.Configurations.Entities
|
||||||
@@ -26,6 +24,21 @@ namespace xAiModels.Configurations.Entities
|
|||||||
ResolutionContext context
|
ResolutionContext context
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
// Retrieve Owner ...
|
||||||
|
var device = identityProvider.GetDevice();
|
||||||
|
var ownerUserInfo = identityProvider.GetUserInfo(
|
||||||
|
device: device,
|
||||||
|
userSelectByParam: source.OwnerId
|
||||||
|
)
|
||||||
|
.GetAwaiter()
|
||||||
|
.GetResult();
|
||||||
|
var owner = ownerUserInfo.ToXPersonDto();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Setting Owner ...
|
||||||
|
destination.Owner = owner;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Retrieve Owner ...
|
// Retrieve Owner ...
|
||||||
// Retrieve Conversation ...
|
// Retrieve Conversation ...
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using xAiModels.Models.Dtos;
|
using xAiModels.Models.Dtos;
|
||||||
using xAiModels.Models.Entities;
|
using xAiModels.Models.Entities;
|
||||||
|
using xIdentityService.Extensions;
|
||||||
using xIdentityService.Interfaces;
|
using xIdentityService.Interfaces;
|
||||||
|
|
||||||
namespace xAiModels.Configurations.Entities
|
namespace xAiModels.Configurations.Entities
|
||||||
@@ -26,6 +24,21 @@ namespace xAiModels.Configurations.Entities
|
|||||||
ResolutionContext context
|
ResolutionContext context
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
// Retrieve Owner ...
|
||||||
|
var device = identityProvider.GetDevice();
|
||||||
|
var ownerUserInfo = identityProvider.GetUserInfo(
|
||||||
|
device: device,
|
||||||
|
userSelectByParam: source.OwnerId
|
||||||
|
)
|
||||||
|
.GetAwaiter()
|
||||||
|
.GetResult();
|
||||||
|
var owner = ownerUserInfo.ToXPersonDto();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Setting Owner ...
|
||||||
|
destination.Owner = owner;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Retrieve Owner ...
|
// Retrieve Owner ...
|
||||||
// Retrieve Title Resources ...
|
// Retrieve Title Resources ...
|
||||||
|
|||||||
@@ -21,9 +21,13 @@ namespace xAiModels.Models.Dtos
|
|||||||
public virtual XPersonDto Owner { get; set; } = null;
|
public virtual XPersonDto Owner { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Title of Conversation ...
|
/// Conversation Title Resource ID ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// All Exists Title Locale Resources ...
|
||||||
|
/// </summary>
|
||||||
public virtual XLocaleResourceDto[] TitleLocales { get; set; }
|
public virtual XLocaleResourceDto[] TitleLocales { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -41,9 +45,24 @@ namespace xAiModels.Models.Dtos
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid ProjectId { get; set; }
|
public Guid ProjectId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Project Title Resource ID ...
|
||||||
|
/// </summary>
|
||||||
public virtual string ProjectTitle { get; set; } = null;
|
public virtual string ProjectTitle { get; set; } = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Project Description Resource ID ...
|
||||||
|
/// </summary>
|
||||||
public virtual string ProjectDescription { get; set; } = null;
|
public virtual string ProjectDescription { get; set; } = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Project Title Locale Resources ...
|
||||||
|
/// </summary>
|
||||||
public virtual XLocaleResourceDto[] ProjectTitleLocales { get; set; }
|
public virtual XLocaleResourceDto[] ProjectTitleLocales { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Project Description Locale Resources ...
|
||||||
|
/// </summary>
|
||||||
public virtual XLocaleResourceDto[] ProjectDescriptionLocales { get; set; }
|
public virtual XLocaleResourceDto[] ProjectDescriptionLocales { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user