last ...
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using xCommons.Extensions;
|
||||
using xDataService.Extensions;
|
||||
using xDataService.Models;
|
||||
@@ -132,6 +133,33 @@ namespace xTagService.Providers
|
||||
return await Task.FromResult(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extract all Referencing Models for Specified Key ...
|
||||
/// </summary>
|
||||
/// <param name="providedForId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<XReference<TKey>>> GetAllReferencings(TKey providedForId)
|
||||
{
|
||||
//
|
||||
// Validate ...
|
||||
var isValid =
|
||||
!providedForId.IsNull();
|
||||
if (!isValid)
|
||||
{
|
||||
xExceptios.InvalidArgs.Throw();
|
||||
}
|
||||
|
||||
//
|
||||
var identifier = GetProvidedID(providedForId);
|
||||
|
||||
//
|
||||
var result = TagProvider.Repository
|
||||
.AsQueryable()
|
||||
.Where(te => te.References.Contains(identifier))
|
||||
.Select(te => te.References)
|
||||
;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Count References ...
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user