Beispiel #1
0
        private static void PreUpdateOrDeleteEventHandler(object src, PreStatementEventArgs evnt)
        {
            Assert.That(((IMappedStatement)src).Id, Is.EqualTo("UpdateAccount"));
            Account account = (Account)evnt.ParameterObject;

            account.EmailAddress = "*****@*****.**";
        }
Beispiel #2
0
        private static void PreInsertEventHandler(object src, PreStatementEventArgs evnt)
        {
            Assert.That(((IMappedStatement)src).Id, Is.EqualTo("InsertAccount"));
            Account account = (Account)evnt.ParameterObject;

            account.EmailAddress = "*****@*****.**";
        }
Beispiel #3
0
        /// <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);
        }
Beispiel #4
0
 private static void PreSelectEventHandler(object src, PreStatementEventArgs evnt)
 {
     Assert.That(((IMappedStatement)src).Id, Is.EqualTo("SelectAccount"));
     evnt.ParameterObject = ((int)evnt.ParameterObject) + 1;
 }
Beispiel #5
0
 private static void PreSelectEventHandler(object src, PreStatementEventArgs evnt)
 {
     Assert.That(((IMappedStatement)src).Id, Is.EqualTo("SelectAccount"));
     evnt.ParameterObject = ((int)evnt.ParameterObject) +1;
 }
Beispiel #6
0
 private static void PreUpdateOrDeleteEventHandler(object src, PreStatementEventArgs evnt)
 {
     Assert.That(((IMappedStatement)src).Id, Is.EqualTo("UpdateAccount"));
     Account account = (Account)evnt.ParameterObject;
     account.EmailAddress = "*****@*****.**";
 }
Beispiel #7
0
 private static void PreInsertEventHandler(object src, PreStatementEventArgs evnt)
 {
     Assert.That(((IMappedStatement)src).Id, Is.EqualTo("InsertAccount"));
     Account account = (Account)evnt.ParameterObject;
     account.EmailAddress = "*****@*****.**";
 }