Skip to content

Global Expression method #1188

@frankiDotNet

Description

@frankiDotNet

Hello,

Is there any way to create mapping with an ExpressionMethodAttribute and call a method that is not defined in the class itself? Say that I couod call a global defined method in multiple classes for mapping.
In my case I would like to map a property to a column if it exists, if my database version is older and the column does not exists in this version, I would overwrite thr mapping for this property to an ExpressionMethod that receives the default value.

// column exists 
[Column("Test")]
Public string TestProperty{ get; set}

// column does not exist
[ExpressionMethod("DefaultStringValueMethod"), IsColumn= true]
Public string TestProperty {get; set;}

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