Skip to content

CustomPropertyTypeMap propertySelector does now allow null #2011

Open
@uitmaurik

Description

@uitmaurik

The constructor of CustomPropertyTypeMap accepts two parameters. The propertySelector parameter is of type Func<Type, string, PropertyInfo>. If I understand correctly this means that the function must always return a PropertyInfo. Returning null is not allowed due to the project setting enable.
As the method public SqlMapper.IMemberMap? GetMember(string columnName) is the only method that uses the propertySelector and is already capable of handling a null return value, I would like to request to modify the constructor to (so changing the return type of the function from PropertyInfo to PropertyInfo?):

public CustomPropertyTypeMap(Type type, Func<Type, string, PropertyInfo?> propertySelector)

and of course the variable to:

private readonly Func<Type, string, PropertyInfo?> _propertySelector;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions