Src/AutoFixture/FixtureFreezer.cs
/// <summary>
/// Freezes the type to a single value.
/// </summary>
/// <typeparam name="T">The type to freeze.</typeparam>
/// <param name="fixture">The fixture.</param>
/// <returns>
/// The value that will subsequently always be created for <typeparamref name="T"/>.
/// </returns>
/// <remarks>
/// <para>
/// The <see cref="Freeze{T}(AutoFixture.IFixture)"/> method freezes the type to always return the same
/// instance whenever an instance of the type is requested either directly, or indirectly as a
/// nested value of other types.
/// </para>
/// </remarks>
/// <seealso cref="Freeze{T}(IFixture, Func{ICustomizationComposer{T}, ISpecimenBuilder})"/>
Freezes the type to a single value.
Freezes the type to a single value .
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Although this CA warning should never be suppressed, this particular usage scenario has been discussed and accepted on the FxCop DL.")]
        public static T Freeze<T>(this IFixture fixture)
        {
            if (fixture == null) throw new ArgumentNullException(nameof(fixture));
            var value = fixture.Create<T>();
            fixture.Inject(value);
            return value;
        }
[ System . Diagnostics . CodeAnalysis . SuppressMessage ( " " , " " , Justification = " " ) ] public static T Freeze < T > ( this IFixture fixture ) { if ( fixture == null ) throw new ArgumentNullException ( nameof ( fixture ) ) ; var value = fixture . Create < T > ( ) ; fixture . Inject ( value ) ; return value ; }
Freezes the type to a single value.
Freezes the type to a single value .
The value that will subsequently always be created for .
The value that will subsequently always be created for .
IFixture
this
fixture
None
typeparam
The type to freeze.
The type to freeze .
remarks
The  method freezes the type to always return the same
instance whenever an instance of the type is requested either directly, or indirectly as a
nested value of other types.
The method freezes the type to always return the same instance whenever an instance of the type is requested either directly or indirectly as a nested value of other types .
seealso
None