private void ProcessMethods(Type type, SqlTable table) { MethodInfo[] methods = type.GetMethods( BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (MethodInfo method in methods) { if (method.IsDefined(typeof(TriggerAttribute), false)) { TriggerAttribute attr = (TriggerAttribute) method.GetCustomAttributes(typeof(TriggerAttribute), false)[0]; SqlTrigger trigger = new SqlTrigger(method, attr.Timing); table.AddTrigger(trigger); } } }
private void ProcessMethods(Type type, LitTable table) { MethodInfo[] methods = type.GetMethods( BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (MethodInfo method in methods) { if (method.IsDefined(typeof(TriggerAttribute), false)) { TriggerAttribute attr = (TriggerAttribute) method.GetCustomAttributes(typeof(TriggerAttribute), false)[0]; SqlTrigger trigger = new SqlTrigger(method, attr.Timing); table.AddTrigger(trigger); } } }
public virtual void AddTrigger(SqlTrigger trigger) { triggers.Add(trigger); }