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?
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?