internal MethodAction(WebWork work, MethodInfo mi, bool async) : base(work, mi.Name, async) { _roles = ((RolesAttribute)mi.GetCustomAttribute(typeof(RolesAttribute), true))?.Roles; // create a doer delegate if (async) { _doAsync = (Func <WebContext, Task>)mi.CreateDelegate(typeof(Func <WebContext, Task>), work); } else { _do = (Action <WebContext>)mi.CreateDelegate(typeof(Action <WebContext>), work); } }
protected WebAction(WebWork work, string name, bool async) { this.work = work; this.name = name; this.async = async; }