private static void PreUpdateOrDeleteEventHandler(object src, PreStatementEventArgs evnt) { Assert.That(((IMappedStatement)src).Id, Is.EqualTo("UpdateAccount")); Account account = (Account)evnt.ParameterObject; account.EmailAddress = "*****@*****.**"; }
private static void PreInsertEventHandler(object src, PreStatementEventArgs evnt) { Assert.That(((IMappedStatement)src).Id, Is.EqualTo("InsertAccount")); Account account = (Account)evnt.ParameterObject; account.EmailAddress = "*****@*****.**"; }
/// <summary> /// Raises the pre event. /// </summary> /// <param name="key">The key.</param> /// <param name="parameterObject">The parameter object.</param> /// <returns>Returns is used as the parameter object</returns> protected object RaisePreEvent(object key, object parameterObject) { var handlers = (EventHandler <PreStatementEventArgs>)events[key]; if (handlers != null) { var eventArgs = new PreStatementEventArgs(); eventArgs.ParameterObject = parameterObject; handlers(this, eventArgs); return(eventArgs.ParameterObject); } return(parameterObject); }
private static void PreSelectEventHandler(object src, PreStatementEventArgs evnt) { Assert.That(((IMappedStatement)src).Id, Is.EqualTo("SelectAccount")); evnt.ParameterObject = ((int)evnt.ParameterObject) + 1; }
private static void PreSelectEventHandler(object src, PreStatementEventArgs evnt) { Assert.That(((IMappedStatement)src).Id, Is.EqualTo("SelectAccount")); evnt.ParameterObject = ((int)evnt.ParameterObject) +1; }