public GraphQuery <T> AddQuery <T>(string operation, T instance) { var query = new GraphQuery <T>(operation); Queries.Add(query); return(query); }
public GraphQuery <JToken> AddSelectionQuery <TInput>(string operation, TInput input, IEnumerable <Field> selections) where TInput : class { if (input != null) { var inputString = GetInputString(input); operation = string.IsNullOrEmpty(inputString) ? $"{operation}" : $"{operation}({inputString})"; } var query = new GraphQuery <JToken>(operation, selections); Queries.Add(query); return(query); }
public GraphQuery <TOutput> AddQuery <TInput, TOutput>(string operation, TInput input, TOutput output) { if (input != null) { var inputString = GetInputString(input); operation = string.IsNullOrEmpty(inputString) ? $"{operation}" : $"{operation}({inputString})"; } var query = new GraphQuery <TOutput>(operation); Queries.Add(query); return(query); }
protected Func <GraphOutput, DateTime> GetCacheUntilWrapper <T>(Func <T, DateTime> cacheUntil, GraphQuery <T> query) { Func <GraphOutput, DateTime> cacheUntilWrapper = null; if (cacheUntil != null) { cacheUntilWrapper = o => cacheUntil(query.Data); } return(cacheUntilWrapper); }