apply some Updates ...
This commit is contained in:
@@ -182,6 +182,13 @@ namespace xTagService.Interfaces
|
||||
int id
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Remove All Specified Tags ...
|
||||
/// </summary>
|
||||
/// <param name="forProvidedId"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> RemoveTagsFor(TKey forProvidedId);
|
||||
|
||||
/// <summary>
|
||||
/// Update Specified Dto ...
|
||||
/// </summary>
|
||||
|
||||
@@ -863,6 +863,42 @@ namespace xTagService.Providers
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove All Specified Tags ...
|
||||
/// </summary>
|
||||
/// <param name="forProvidedId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> RemoveTagsFor(TKey forProvidedId)
|
||||
{
|
||||
//
|
||||
var result = false;
|
||||
|
||||
//
|
||||
var dtos = await GetTags(forProvidedId);
|
||||
result = !dtos.IsNull() && dtos.HasChild();
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
foreach (var dto in dtos)
|
||||
{
|
||||
//
|
||||
try
|
||||
{
|
||||
//
|
||||
await Detach(dto.Tag, forProvidedId);
|
||||
if (!result)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update Specified Dto ...
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user