/// <summary> /// Returns a string that represents the current object. /// </summary> /// <returns>A string that represents the current object.</returns> public override string ToString() { var sb = new StringBuilder(); sb.Append($"QueryOptions<{typeof(T).Name}>: [ "); sb.Append(_specificationStrategy != null ? $"\n\t{_specificationStrategy.ToString()}," : $"\n\tSpecificationQueryStrategy<{typeof(T).Name}>: [ null ],"); sb.Append(_fetchStrategy != null ? $"\n\t{_fetchStrategy.ToString()}," : $"\n\tFetchQueryStrategy<{typeof(T).Name}>: [ null ],"); if (_sortingPropertiesMapping != null && _sortingPropertiesMapping.Any()) { sb.Append($"\n\tSort: [ {string.Join(", ", _sortingPropertiesMapping.Select(x => x.Key + " = " + x.Value).ToArray())} ],"); } else { sb.Append("\n\tSort: [ null ],"); } sb.Append($"\n\tPage: [ Index = {_pageIndex}, Size = {_pageSize} ]"); sb.Append(" ]"); return(sb.ToString()); }
private static string FormatFetchQueryStrategy <T>([CanBeNull] IFetchQueryStrategy <T> fetchStrategy) { return(fetchStrategy != null?fetchStrategy.ToString() : $"FetchQueryStrategy<{Name<T>()}>: [ null ]"); }