Skip to content

Use Expression.Lambda #71

@JohanLarsson

Description

@JohanLarsson
internal static class PropertyInfoExt
{
    internal static Func<TSource, TValue> CreateGetter<TSource, TValue>(this PropertyInfo property)
    {
        var parameter = Expression.Parameter(typeof(TSource));
        return Expression.Lambda<Func<TSource, TValue>>(Expression.Property(parameter, property), parameter)
                         .Compile();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions