src/Mimp.SeeSharper.Reflection/TypeExtensions.Cast.cs
/// <summary>
/// Return a compiled function to cast a object of <paramref name="source"/> to <paramref name="destination"/>.
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <typeparam name="TDestination"></typeparam>
/// <param name="source"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="InvalidOperationException">If source isn't castable to destination.</exception>
Return a compiled function to cast a object of  to .
Return a compiled function to cast a object of to .
public static Func<TSource, TDestination> GetCastFunc<TSource, TDestination>(this Type source)
        {
            if (source is null)
                throw new ArgumentNullException(nameof(source));
            return source.GetCastDelegate<Func<TSource, TDestination>>();
        }
public static Func < TSource , TDestination > GetCastFunc < TSource , TDestination > ( this Type source ) { if ( source is null ) throw new ArgumentNullException ( nameof ( source ) ) ; return source . GetCastDelegate < Func < TSource , TDestination > > ( ) ; }
Return a compiled function to cast a object of  to .
Return a compiled function to cast a object of to .
None
None
If source isn't castable to destination.
If source isn ' t castable to destination .
Type
this
source
None
typeparam
None
typeparam
None