/// <summary> /// Only used in cache-only mode (no persistence). Declare a subset of the data as being fully loaded into the cache /// Any expression that can be used for querying is valid here /// </summary> /// <param name="domainDefinition"></param> /// <param name="humanReadableDescription">Optional description of the loaded domain</param> public void DeclareLoadedDomain([NotNull] Expression <Func <T, bool> > domainDefinition, string humanReadableDescription = null) { if (domainDefinition == null) { throw new ArgumentNullException(nameof(domainDefinition)); } var query = PredicateToQuery(domainDefinition); query.CollectionName = _collectionName; var domain = new DomainDescription(query, false, humanReadableDescription); _client.DeclareDomain(domain); }
public static void DeclareDomain <T>(this IDataClient @this, Expression <Func <T, bool> > where) { var query = PredicateToQuery(where); @this.DeclareDomain(new DomainDescription(query)); }