示例#1
0
        private void ProcessMethods(Type type, SqlTable table)
        {
            var methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

            if (methods == null)
            {
                return;
            }

            foreach (var method in methods)
            {
                if (!method.IsDefined(typeof(TriggerAttribute), false))
                {
                    continue;
                }

                var triggerAttribute = (TriggerAttribute)method.GetCustomAttributes(typeof(TriggerAttribute), false)[0];
                var trigger          = new SqlTrigger(method, triggerAttribute.Timing);
                table.AddTrigger(trigger);
            }
        }
示例#2
0
 public virtual void AddTrigger(SqlTrigger trigger)
 {
     triggers.Add(trigger);
 }