Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Class PropertyAccess

    Utility class that provides property access based on strings.

    Inheritance
    System.Object
    PropertyAccess
    Namespace: Radzen
    Assembly: Radzen.Blazor.dll
    Syntax
    public static class PropertyAccess : object

    Methods

    DateOnlyFromDateTime(DateTime)

    Determines whether the specified type is a DateOnly.

    Declaration
    public static object DateOnlyFromDateTime(DateTime source)
    Parameters
    Type Name Description
    DateTime source

    The source.

    Returns
    Type Description
    System.Object

    true if the specified type is a DateOnly instance or nullable DateOnly; otherwise, false.

    GetDynamicPropertyExpression(String, Type)

    Gets the dynamic property expression when binding to IDictionary.

    Declaration
    public static string GetDynamicPropertyExpression(string name, Type type)
    Parameters
    Type Name Description
    System.String name

    The property name.

    Type type

    The property type.

    Returns
    Type Description
    System.String

    Dynamic property expression.

    GetElementType(Type)

    Gets the type of the element of a collection time.

    Declaration
    public static Type GetElementType(Type type)
    Parameters
    Type Name Description
    Type type

    The type.

    Returns
    Type Description
    Type

    The type of the collection element.

    GetItemOrValueFromProperty(Object, String)

    Gets the item or value from property.

    Declaration
    public static object GetItemOrValueFromProperty(object item, string property)
    Parameters
    Type Name Description
    System.Object item

    The item.

    System.String property

    The property.

    Returns
    Type Description
    System.Object

    System.Object.

    GetProperty(String)

    Converts the property to a value that can be used by Dynamic LINQ.

    Declaration
    public static string GetProperty(string property)
    Parameters
    Type Name Description
    System.String property

    The property.

    Returns
    Type Description
    System.String

    GetPropertyType(Type, String)

    Gets the type of the property.

    Declaration
    public static Type GetPropertyType(Type type, string property)
    Parameters
    Type Name Description
    Type type

    The type.

    System.String property

    The property.

    Returns
    Type Description
    Type

    Type.

    Getter<T>(Object, String)

    Creates a function that returns the specified property.

    Declaration
    public static Func<object, T> Getter<T>(object data, string propertyName)
    Parameters
    Type Name Description
    System.Object data

    The value.

    System.String propertyName

    The name of the property to return.

    Returns
    Type Description
    Func<System.Object, T>

    A function that returns the specified property.

    Type Parameters
    Name Description
    T

    The value type

    Getter<TItem, TValue>(String, Type)

    Creates a function that will return the specified property.

    Declaration
    public static Func<TItem, TValue> Getter<TItem, TValue>(string propertyName, Type type = null)
    Parameters
    Type Name Description
    System.String propertyName

    Name of the property to return.

    Type type

    Type of the object.

    Returns
    Type Description
    Func<TItem, TValue>

    A function which return the specified property by its name.

    Type Parameters
    Name Description
    TItem

    The owner type.

    TValue

    The value type.

    GetValue(Object, String)

    Gets the value of the specified expression via reflection.

    Declaration
    public static object GetValue(object value, string path)
    Parameters
    Type Name Description
    System.Object value

    The value.

    System.String path

    The path.

    Returns
    Type Description
    System.Object

    The value of the specified expression or value if not found.

    IsAnonymous(Type)

    Determines whether the specified type is anonymous.

    Declaration
    public static bool IsAnonymous(this Type type)
    Parameters
    Type Name Description
    Type type

    The type.

    Returns
    Type Description
    System.Boolean

    true if the specified type is anonymous; otherwise, false.

    IsDate(Type)

    Determines whether the specified type is a .

    Declaration
    public static bool IsDate(Type source)
    Parameters
    Type Name Description
    Type source

    The source.

    Returns
    Type Description
    System.Boolean

    true if the specified type is a DateTime instance or nullable DateTime; otherwise, false.

    IsDateOnly(Type)

    Determines whether the specified type is a DateOnly.

    Declaration
    public static bool IsDateOnly(Type source)
    Parameters
    Type Name Description
    Type source

    The source.

    Returns
    Type Description
    System.Boolean

    true if the specified type is a DateOnly instance or nullable DateOnly; otherwise, false.

    IsEnum(Type)

    Determines whether the specified type is an enum.

    Declaration
    public static bool IsEnum(Type source)
    Parameters
    Type Name Description
    Type source

    The type.

    Returns
    Type Description
    System.Boolean

    true if the specified source is an enum; otherwise, false.

    IsNullableEnum(Type)

    Determines whether the specified type is a Nullable enum.

    Declaration
    public static bool IsNullableEnum(Type source)
    Parameters
    Type Name Description
    Type source

    The type.

    Returns
    Type Description
    System.Boolean

    true if the specified source is an enum; otherwise, false.

    IsNumeric(Type)

    Determines whether the specified type is numeric.

    Declaration
    public static bool IsNumeric(Type source)
    Parameters
    Type Name Description
    Type source

    The type.

    Returns
    Type Description
    System.Boolean

    true if the specified source is numeric; otherwise, false.

    ReplaceFirst(String, String, String)

    Method to only replace first occurence of a substring in a string

    Declaration
    public static string ReplaceFirst(this string text, string search, string replace)
    Parameters
    Type Name Description
    System.String text
    System.String search
    System.String replace
    Returns
    Type Description
    System.String

    TryGetItemOrValueFromProperty<T>(Object, String, out T)

    Tries to get a property by its name.

    Declaration
    public static bool TryGetItemOrValueFromProperty<T>(object item, string property, out T result)
    Parameters
    Type Name Description
    System.Object item

    The item.

    System.String property

    The property.

    T result

    The property value.

    Returns
    Type Description
    System.Boolean

    true if successful, false otherwise.

    Type Parameters
    Name Description
    T

    The target type

    Introducing Radzen Blazor Studio

    Radzen Blazor Studio is a software development environment that empowers developers to design, build and deploy Blazor applications without the traditional hurdles. Write less code and get more done.

    Learn More

    Download Now
    Download Now
    In This Article
    Back to top Radzen Blazor Components, © 2018-2025 Radzen. Source Code licensed under MIT