/// <summary> /// Create a fetching strategy for the specified property or association path. /// </summary> /// <param name="path"> /// The association path. /// </param> /// <param name="alias"> /// The alias. /// </param> /// <returns> /// A <see cref="IFetchBuilder{TQuery}" /> instance. /// </returns> protected virtual IFetchBuilder <TQuery> FetchCore ( string path, string alias) { if (Fetches.Count > 0 && Fetches.Any(x => x.HasAlias)) { string[] steps = path.Split('.'); if (steps.Length > 1) { for (int i = 0; i < steps.Length; i++) { Fetch fetch = Fetches .SingleOrDefault(x => x.HasAlias && x.Alias == steps[i]); if (fetch != null) { steps[i] = fetch.Path; } } path = string.Join(".", steps); } } return(new FetchBuilder <TQuery>(this, Query, path, alias)); }
/// <inheritdoc /> public virtual TQuery ClearFetches() { Fetches.Clear(); return(Query); }