| | | 1 | | //======================================================================= |
| | | 2 | | // ITransient.Extensions.cs |
| | | 3 | | //======================================================================= |
| | | 4 | | // MIT License, Copyright (c) 2024-present David Oravsky (mrdav30) |
| | | 5 | | // See LICENSE file in the project root for full license information. |
| | | 6 | | //======================================================================= |
| | | 7 | | |
| | | 8 | | namespace Trailblazer.Support; |
| | | 9 | | |
| | | 10 | | /// <summary> |
| | | 11 | | /// Extension methods for ITransient to allow calling without casting to the interface. |
| | | 12 | | /// This is purely for convenience and does not change the underlying behavior. |
| | | 13 | | /// </summary> |
| | | 14 | | public static class ITransientExtensions |
| | | 15 | | { |
| | | 16 | | /// <inheritdoc cref="ITransient.SyncTransientState"/> |
| | | 17 | | public static void SyncTransientState(this ITransient instance, ITransient other) |
| | 3 | 18 | | => TransientStateUtility.Sync(instance, other); |
| | | 19 | | |
| | | 20 | | /// <inheritdoc cref="ITransient.ClearTransientState"/> |
| | | 21 | | public static void ClearTransientState(this ITransient instance) |
| | 44 | 22 | | => TransientStateUtility.Clear(instance); |
| | | 23 | | } |