private void EntityPersisting(Colosoft.Business.EntityPersistingEventArgs e) { if (e.Entity is TEntidade && e.Entity.IsChanged) { var action = e.AfterSession.LastOrDefault() ?? e.Session.LastOrDefault(); Colosoft.Data.PersistenceActionCallback handler = null; handler = (action1, result1) => { action.Callback -= handler; if (result1.Success) { this.EntidadeAtualizada((TEntidade)e.Entity); } }; if (action != null) { action.Callback += handler; } } }
/// <summary> /// Método acionado quando uma entidade estiver sendo persistida. /// </summary> /// <param name="e"></param> private static void OnPersistingEntity(Colosoft.Business.EntityPersistingEventArgs e) { ControleAlteracao.RegistraAlteracoes(e.AfterSession, e.Entity); }