last ...
This commit is contained in:
@@ -9,6 +9,7 @@ using xCommons.Configurations;
|
||||
using xCommons.Extensions;
|
||||
using xExceptions.Constants;
|
||||
using xIdentityModels.Models;
|
||||
using xModels.Dtos;
|
||||
using xPushService.Providers;
|
||||
|
||||
namespace xCategoryService.Providers
|
||||
@@ -147,27 +148,33 @@ namespace xCategoryService.Providers
|
||||
|
||||
//
|
||||
id = item.Id;
|
||||
var titleResourceTitle = await titleResourceProvider.AddOrUpdateItemResourcer(
|
||||
identifier: id,
|
||||
language: langauge,
|
||||
translation: title,
|
||||
userInfo: userInfo,
|
||||
connectionId: connectionId,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
var descriptionResourceTitle = await descriptionResourceProvider.AddOrUpdateItemResourcer(
|
||||
identifier: id,
|
||||
language: langauge,
|
||||
userInfo: userInfo,
|
||||
translation: description,
|
||||
connectionId: connectionId,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
var titleResource = await titleResourceProvider
|
||||
.AddOrUpdateLocale(
|
||||
identifier: id,
|
||||
locale: new XLocaleResourceDto
|
||||
{
|
||||
Value = title,
|
||||
Language = langauge
|
||||
},
|
||||
connectionId: connectionId,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
var descriptionResource = await descriptionResourceProvider
|
||||
.AddOrUpdateLocale(
|
||||
identifier: id,
|
||||
locale: new XLocaleResourceDto
|
||||
{
|
||||
Value = description,
|
||||
Language = langauge
|
||||
},
|
||||
connectionId: connectionId,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
//
|
||||
// Update Category Dto ...
|
||||
item.Title = titleResourceTitle;
|
||||
item.Description = descriptionResourceTitle;
|
||||
item.Title = titleResource.Resource;
|
||||
item.Description = descriptionResource.Resource;
|
||||
item = await base.Update(
|
||||
id: id,
|
||||
item: item,
|
||||
@@ -175,7 +182,6 @@ namespace xCategoryService.Providers
|
||||
connectionId: connectionId,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -201,33 +207,13 @@ namespace xCategoryService.Providers
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<bool> RemoveResaource(
|
||||
public async Task<XCategoryResourceDto> Update(
|
||||
int id,
|
||||
CancellationToken cancellationToken
|
||||
)
|
||||
{
|
||||
//
|
||||
// Validate ...
|
||||
var isValid = id.IsValidIntId();
|
||||
if (!isValid)
|
||||
{
|
||||
XException.InvalidArgs.Throw();
|
||||
}
|
||||
|
||||
//
|
||||
// Retrieve Resource ...
|
||||
var resource = await GetResource(
|
||||
id: id,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
isValid = !resource.IsNullOrDefault();
|
||||
if (!isValid)
|
||||
{
|
||||
XException.NotFound.Throw();
|
||||
}
|
||||
|
||||
//
|
||||
await titleResourceProvider.RemoveResource();
|
||||
}
|
||||
XCategoryDto item,
|
||||
string langauge = null,
|
||||
string connectionId = null,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
CancellationToken cancellationToken = default
|
||||
) {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user