last ...
This commit is contained in:
@@ -5,7 +5,6 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using xCommons.Extensions;
|
||||
using xExceptions.Constants;
|
||||
using xIdentityModels.Models;
|
||||
using xModels.Dtos;
|
||||
using xStringService.Extensions;
|
||||
using xStringService.Interfaces;
|
||||
@@ -181,13 +180,11 @@ namespace xStringService.Providers
|
||||
/// Add or Update a Resource Model ...
|
||||
/// </summary>
|
||||
/// <param name="resource">a XResourceDto Model ...</param>
|
||||
/// <param name="userInfo">Actor User for Permissions ...</param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task<XResourceDto> AddOrUpdateResource(
|
||||
XResourceDto resource,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
@@ -209,7 +206,6 @@ namespace xStringService.Providers
|
||||
{
|
||||
await RemoveResource(
|
||||
resource: result,
|
||||
userInfo: userInfo,
|
||||
connectionId: connectionId,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
@@ -248,7 +244,6 @@ namespace xStringService.Providers
|
||||
/// <returns></returns>
|
||||
public virtual async Task<XResourceDto> AddOrUpdateLocale(
|
||||
XLocaleResourceDto locale,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
@@ -297,11 +292,11 @@ namespace xStringService.Providers
|
||||
/// Remove Locale ...
|
||||
/// </summary>
|
||||
/// <param name="locale"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task<XResourceDto> RemoveLocale(
|
||||
XLocaleResourceDto locale,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
@@ -334,17 +329,26 @@ namespace xStringService.Providers
|
||||
/// Remove Specified Resource Model ...
|
||||
/// </summary>
|
||||
/// <param name="resource">a XResourceDto Model ...</param>
|
||||
/// <param name="userInfo">Actor User for Permissions ...</param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task RemoveResource(
|
||||
XResourceDto resource,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
// Validate Resource ...
|
||||
var isValid =
|
||||
!resource.IsNullOrDefault() &&
|
||||
!resource.Resource.IsNullOrEmpty() &&
|
||||
resource.Resource == this.resource;
|
||||
if (!isValid)
|
||||
{
|
||||
XException.InvalidArgs.Throw();
|
||||
}
|
||||
|
||||
//
|
||||
var items = await ExtractItems(cancellationToken);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user