using System; using System.Collections.Generic; using System.Text; namespace Apewer.Web { internal class ApiMiddleware { internal Type Type; internal Action Callback; public ApiMiddleware(Type type) { if (!typeof(IApiMiddleware).IsAssignableFrom(type)) throw new NotImplementedException($"类型【{type.FullName}】未实现【{nameof(IApiMiddleware)}】。"); Type = type; } public ApiMiddleware(Action callback) { if (callback == null) throw new ArgumentNullException(nameof(callback)); Callback = callback; } } }