All my entities have the following properties:
- public virtual DateTime CreatedDate {get; set;}
- public virtual string CreatedBy { get; set; }
- public virtual DateTime UpdatedDate { get; set; }
- public virtual string UpdatedBy { get; set; }
I've implemented a EventListener (IPreUpdateEventListener, IPreInsertEventListener) so that I can fill these properties before inserting/updating my entity.
I do not load my entity just before saving cause I've got all my fields in a view (id, version). The only thing I would like to avoid to put in hidden fields (of my view) are CreatedDate and CreateBy.
Since I fill these fields only once, when the entity is created the first time, I was wondering if there's a way to exclude them when I update (only update) my entitiy?!
Thanks.