withSIX.Mini.Applications.Services.Infra.ContentQuery.IsMatch C# (CSharp) Method

IsMatch() public method

public IsMatch ( ModClientApiJsonV3WithGameId c ) : bool
c ModClientApiJsonV3WithGameId
return bool
        public bool IsMatch(ModClientApiJsonV3WithGameId c)
            => c.Publishers.Any(x => Publishers.Any(p => (p.Id == x.Id) && (p.Type == x.Type)))
               || PackageNames.ContainsIgnoreCase(c.PackageName)
               || Ids.Contains(c.Id);

Same methods

ContentQuery::IsMatch ( ModNetworkContent c ) : bool

Usage Example

 private static Dictionary<Guid, ModClientApiJsonV3WithGameId> GetTheDesiredMods(Game game,
     ContentQuery filterFunc,
     IDictionary<Guid, ModClientApiJsonV3WithGameId> onlineContent) {
     var desired = onlineContent.Where(x => filterFunc.IsMatch(x.Value));
     var dependencyChain = new Dictionary<Guid, ModClientApiJsonV3WithGameId>();
     GetRelatedContent(game, desired.Select(x => x.Value), dependencyChain, onlineContent);
     return dependencyChain;
 }
ContentQuery