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); } }
public virtual void AddTrigger(SqlTrigger trigger) { triggers.Add(trigger); }