Beispiel #1
0
        protected bool HasConcurrency(ISystemFields entity, ISystemModelFields model)
        {
            if (entity == null ||
                model == null ||
                entity.ChangeDate == DateTime.MinValue) //exclude tables without ChangeDate field. DateTime.MinValue is a default for them
            {
                return(false);
            }
            var diff = entity.ChangeDate.Subtract(model.changeDate);

            return(diff.Seconds < -1 || diff.Seconds > 1);
        }
Beispiel #2
0
 protected void SetChangeDate(ISystemFields entity)
 {
     entity.ChangeDate = DateTime.Now;
 }