Show / Hide Table of Contents

    Class PropertyName<P>

    Helper for getting property name from class.

    Inheritance
    System.Object
    PropertyName<P>
    Namespace: Kros.KORM.Helper
    Assembly: Kros.KORM.dll
    Syntax
    public static class PropertyName<P>
    
        where P : class
    Type Parameters
    Name Description
    P

    Class type, from want get property name

    Examples
                var propName = PropertyName<Person>.GetPropertyName((p) => p.FirstName);

    Methods

    GetPropertyName<T>(Expression<Func<P, T>>)

    Gets the name of the property.

    Declaration
    public static string GetPropertyName<T>(Expression<Func<P, T>> expression)
    Parameters
    Type Name Description
    System.Linq.Expressions.Expression<System.Func<P, T>> expression

    The expression with property.

    Returns
    Type Description
    System.String

    Property name.

    Type Parameters
    Name Description
    T
    Examples
                var propName = PropertyName<Person>.GetPropertyName((p) => p.FirstName);
    Back to top KROS a.s.