Skip to content

Commit

Permalink
v9.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Abraham committed Dec 6, 2024
1 parent a098db9 commit f2a5ee5
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ public static IServiceCollection AddGraphQL(this IServiceCollection @this)
/// Place to make calls to:<br/>
/// <c>
/// <see cref="OutputGraphType{T}.AddField(MethodInfo)"/><br/>
/// <see cref="OutputGraphType{T}.AddQueryItem{CHILD, MATCH}(MethodInfo, Func{T, MATCH}, Func{CHILD, MATCH})"/><br/>
/// <see cref="OutputGraphType{T}.AddQueryCollection{CHILD, MATCH}(MethodInfo, Func{T, MATCH}, Func{CHILD, MATCH})"/>
/// <see cref="OutputGraphType{T}.AddField(PropertyInfo)<br/>
/// <see cref="OutputGraphType{T}.AddField{ITEM}(MethodInfo, Func{T, ITEM[], ITEM})"/>
/// <see cref="OutputGraphType{T}.AddField{ITEM}(MethodInfo, Func{T, ITEM[], ITEM[]})"/>
/// </c>
/// </param>
public static IServiceCollection AddGraphQLTypeExtensions<T>(this IServiceCollection @this, Action<OutputGraphType<T>> options)
Expand Down
6 changes: 3 additions & 3 deletions src/TypeCache/Extensions/ActionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ public static class ActionExtensions
/// Retry a failed <see cref="Action"/>. The # of <c><paramref name="retryDelays"/></c> dictates the # of retry attempts.<br/>
/// Some built-in interval sequences to use for retry delays:<br/>
/// <list type="table">
/// <item><c><see cref="Sequence.ExponentialSeconds()"/></c></item>
/// <item><c><see cref="Sequence.ExponentialSeconds(uint)"/></c></item>
/// <item><c><see cref="Sequence.LinearTime(TimeSpan)"/></c></item>
/// <item><c><see cref="Sequence.ExponentialSeconds(int)"/></c></item>
/// <item><c><see cref="Sequence.ExponentialSeconds(uint, int)"/></c></item>
/// <item><c><see cref="Sequence.LinearTime(TimeSpan, int)"/></c></item>
/// </list>
/// These are increasing infinite sequences, hence an infinite # of retries will be attempted.<br/>
/// To limit the number of retries, call Linq's Take(...) method on the returned collection.
Expand Down
8 changes: 5 additions & 3 deletions src/TypeCache/Extensions/FuncExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) 2021 Samuel Abraham

using TypeCache.Utilities;

namespace TypeCache.Extensions;

public static class FuncExtensions
Expand All @@ -8,9 +10,9 @@ public static class FuncExtensions
/// Retry a failed <see cref="Func{TResult}"/>. The # of <c><paramref name="retryDelays"/></c> dictates the # of retry attempts.<br/>
/// Some built-in interval sequences to use for retry delays:<br/>
/// <list type="table">
/// <item><c><see cref="Sequence.ExponentialSeconds()"/></c></item>
/// <item><c><see cref="Sequence.ExponentialSeconds(uint)"/></c></item>
/// <item><c><see cref="Sequence.LinearTime(TimeSpan)"/></c></item>
/// <item><c><see cref="Sequence.ExponentialSeconds(int)"/></c></item>
/// <item><c><see cref="Sequence.ExponentialSeconds(uint, int)"/></c></item>
/// <item><c><see cref="Sequence.LinearTime(TimeSpan, int)"/></c></item>
/// </list>
/// These are increasing infinite sequences, hence an infinite # of retries will be attempted.<br/>
/// To limit the number of retries, call Linq's Take(...) method on the returned collection.
Expand Down
26 changes: 13 additions & 13 deletions src/TypeCache/Extensions/ReflectionExtensions.FieldInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ namespace TypeCache.Extensions;
public partial class ReflectionExtensions
{
/// <remarks>
/// <b>The code to get the field value is built once and used subsequently.<br/>
/// The code to get the field value is built once and used subsequently.<br/>
/// This is much faster than late binding.<br/>
/// In the case of a constant, <c><see cref="FieldInfo.GetRawConstantValue"/></c> is used instead.</b>
/// In the case of a constant, <c><see cref="FieldInfo.GetRawConstantValue"/></c> is used instead.
/// </remarks>
[MethodImpl(AggressiveInlining), DebuggerHidden]
public static object? GetStaticValue(this FieldInfo @this)
=> TypeStore.StaticFieldGetFuncs[@this.FieldHandle]();

/// <remarks>
/// <b>The code to get the static field value is built once and used subsequently.<br/>
/// This is much faster than late binding.<br/>
/// The code to get the static field value is built once and used subsequently.<br/>
/// This is much faster than late binding.
/// </remarks>
[MethodImpl(AggressiveInlining), DebuggerHidden]
public static Func<object?> GetStaticValueFunc(this FieldInfo @this)
=> TypeStore.StaticFieldGetFuncs[@this.FieldHandle];

/// <remarks>
/// <b>The code to get the field value is built once and used subsequently.<br/>
/// This is much faster than late binding.<br/>
/// In the case of a constant, <c><see cref="FieldInfo.GetRawConstantValue"/></c> is used instead.</b>
/// The code to get the field value is built once and used subsequently.<br/>
/// This is much faster than late binding.
/// In the case of a constant, <c><see cref="FieldInfo.GetRawConstantValue"/></c> is used instead.
/// </remarks>
[MethodImpl(AggressiveInlining), DebuggerHidden]
public static object? GetValueEx(this FieldInfo @this, object instance)
Expand All @@ -39,13 +39,13 @@ public partial class ReflectionExtensions
=> TypeStore.FieldGetFuncs[@this.FieldHandle];

/// <remarks>
/// <b>The code to set the field is built once and used subsequently.<br/>
/// This is much faster than late binding.</b>
/// The code to set the field is built once and used subsequently.<br/>
/// This is much faster than late binding.
/// </remarks>
/// <param name="instance">Pass <c><see langword="null"/></c> if this is a static field.</param>
[MethodImpl(AggressiveInlining), DebuggerHidden]
public static void SetStaticValue(this FieldInfo @this, object? value)
=> TypeStore.StaticFieldSetActions[@this.FieldHandle](value);
public static void SetStaticValue(this FieldInfo @this, object? instance)
=> TypeStore.StaticFieldSetActions[@this.FieldHandle](instance);

[MethodImpl(AggressiveInlining), DebuggerHidden]
public static Action<object?> SetStaticValueAction(this FieldInfo @this)
Expand All @@ -56,8 +56,8 @@ public static void SetStaticValue(this FieldInfo @this, object? value)
=> TypeStore.FieldSetActions[@this.FieldHandle];

/// <remarks>
/// <b>The code to set the field is built once and used subsequently.<br/>
/// This is much faster than late binding.</b>
/// The code to set the field is built once and used subsequently.<br/>
/// This is much faster than late binding.
/// </remarks>
/// <param name="instance">Pass <c><see langword="null"/></c> if this is a static field.</param>
public static void SetValueEx(this FieldInfo @this, object instance, object? value)
Expand Down
8 changes: 4 additions & 4 deletions src/TypeCache/Extensions/ReflectionExtensions.PropertyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace TypeCache.Extensions;
public partial class ReflectionExtensions
{
/// <summary>
/// Call this instead of <c><see cref="PropertyInfo.GetValue(object?)"/></c> or <c><see cref="PropertyInfo.GetValue(object?, object?[]?)"/></c> for added performance improvement.
/// Call this instead of <c><see cref="PropertyInfo.GetValue(object)"/></c> or <c><see cref="PropertyInfo.GetValue(object, object[])"/></c> for added performance improvement.
/// </summary>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="ArgumentOutOfRangeException"></exception>
Expand Down Expand Up @@ -39,7 +39,7 @@ public static Delegate GetValueDelegate(this PropertyInfo @this)
}

/// <summary>
/// Call this instead of <c><see cref="PropertyInfo.GetValue(object?)"/></c> or <c><see cref="PropertyInfo.GetValue(object?, object?[]?)"/></c> for added performance improvement.
/// Call this instead of <c><see cref="PropertyInfo.GetValue(object)"/></c> or <c><see cref="PropertyInfo.GetValue(object, object[])"/></c> for added performance improvement.
/// </summary>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="ArgumentOutOfRangeException"></exception>
Expand Down Expand Up @@ -73,7 +73,7 @@ public static void SetStaticValue(this PropertyInfo @this, object? value)
/// </summary>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="ArgumentOutOfRangeException"></exception>
/// <param name="indexesAndValue">The last field of the tuple should be the value to set the property to./param>
/// <param name="indexesAndValue">The last field of the tuple should be the value to set the property to.</param>
[MethodImpl(AggressiveInlining), DebuggerHidden]
public static void SetStaticValue(this PropertyInfo @this, ITuple indexesAndValue)
=> @this.SetStaticValueAction()(indexesAndValue);
Expand Down Expand Up @@ -104,7 +104,7 @@ public static void SetValueEx(this PropertyInfo @this, object instance, object?
/// </summary>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="ArgumentOutOfRangeException"></exception>
/// <param name="indexesAndValue">The last field of the tuple should be the value to set the property to./param>
/// <param name="indexesAndValue">The last field of the tuple should be the value to set the property to.</param>
public static void SetValueEx(this PropertyInfo @this, object instance, ITuple indexesAndValue)
{
var indexParameters = @this.GetIndexParameters();
Expand Down
2 changes: 1 addition & 1 deletion src/TypeCache/Utilities/ObservableAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace TypeCache.Utilities;

/// <summary>
/// <see cref="IObservable{T}"> adapter for <see cref="IAsyncEnumerable{T}"/>.
/// <see cref="IObservable{T}"/> adapter for <see cref="IAsyncEnumerable{T}"/>.
/// </summary>
public sealed class ObservableAdapter<T>
: IObservable<object?>, IDisposable
Expand Down
2 changes: 1 addition & 1 deletion src/TypeCache/Utilities/Sequence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class Sequence
/// Use Linq's Skip method to change the start of the sequence.<br/>
/// Use Linq's Select method to cap values at a maximum or minimum.
/// </summary>
/// <param name="count">The power to use in generating the sequence. (<c>i^<paramref name="exponent"/></c>).</param>
/// <param name="count"># of values in the sequence.</param>
/// <returns>A sequence of <c><paramref name="count"/></c> <c><see cref="TimeSpan"/></c> values.</returns>
[MethodImpl(AggressiveInlining), DebuggerHidden]
public static IEnumerable<TimeSpan> ExponentialSeconds(int count)
Expand Down
18 changes: 4 additions & 14 deletions tests/TypeCache.GraphQL.TestApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2021 Samuel Abraham

using GraphQL.Server.Ui.Playground;
using GraphiQl;
using Microsoft.Data.SqlClient;
using TypeCache.Attributes;
using TypeCache.Data;
Expand Down Expand Up @@ -53,19 +53,9 @@
schema.AddVersion("1.0");
schema.AddDatabaseSchemaQueries(dataSource);
})
.UseGraphQLPlayground("/playground", new()
{
BetaUpdates = true,
EditorCursorShape = EditorCursorShape.Line,
EditorFontFamily = "Lucida Console",
EditorFontSize = 12,
EditorReuseHeaders = true,
EditorTheme = EditorTheme.Dark,
HideTracingResponse = true,
PrettierTabWidth = 2,
SchemaPollingEnabled = true,
SchemaPollingInterval = 10000
});
.UseGraphiQl("/playground/custom", "/graphql/custom")
.UseGraphiQl("/playground/data", "/graphql/data")
.UseGraphiQl("/playground/schema", "/graphql/schema");

await app.RunAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GraphQL.Server.Ui.Playground" Version="8.1.0" />
<PackageReference Include="graphiql" Version="2.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
</ItemGroup>

Expand Down

0 comments on commit f2a5ee5

Please sign in to comment.