Looking through the forums i've found a couple of mentions of Client side updates for concurrency control rather than using triggers or the timestamp functionality. The following post is pretty much what i was after (except i'm planning to use a date field called 'LastEdit' for auditing purposes):
http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=977
public override bool SaveEntity(...)
{
// Updating an existing entity
if (!entityToSave.IsNew)
{
IEntityFieldCore leField = entityToSave.Fields["LastEdit"];
if ((leField != null)&& (!leField .IsChanged))
{
leField.SetNewFieldValue("LastEdit", DateTime.Now);
}
}
return base.SaveEntity (entityToSave, refetchAfterSave, updateRestriction, recurse);
}
How does the above code work when saving an entity collection? I've been able to override the SaveEntity and set LastEdit for individual entity saves but how do you set fields when using the SaveEntityCollection method?
Also does this have an advantage in that the concurrency field does not have to be re-fethed from the database so it would be (slightly) more efficient?