private void OrganizeChain() { bool HasEnd = false; foreach (var item in this.MiddleWares) { if (item.GetType() == typeof(EndMiddleWare)) { HasEnd = true; } } if (!HasEnd) { this.MiddleWares.Add(new EndMiddleWare()); } int count = this.MiddleWares.Count; for (int i = 0; i < count; i++) { if (i < count - 1) { this.MiddleWares[i].Next = this.MiddleWares[i + 1]; } } this.StartWare = this.MiddleWares[0]; }
public KoobooHttpApplication(IKoobooMiddleWare start) { this.start = start; }