Skip to content

Feature request - IgnoreOnInsert and IgnoreOnUpdate properties #421

Description

@Andrei-

I often have the scenario where I have a table column like CreatedDate or UniqueGuid column which should be handled by the database only. So basically I never want to touch those columns when inserting or updating pocos, but I want the values when I query.
I couldn't solve this nicely with ResultColumn or Ignore attributes as they will not load the column. If there is an elegant solution and I missed the obvious, I would love to hear it..

What I ended up doing was having two classes for each table. For example on entities that need a CreatedDate, I have a class without that property for inserting and updating and a second class with that property for querying. The second class is just inheriting the first and adds the CreatedDate property.
Any chance of having these attributes added into Petapoco?

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