diff --git a/Project-Unite/Models/WikiModels.cs b/Project-Unite/Models/WikiModels.cs index 96e0858..a697496 100644 --- a/Project-Unite/Models/WikiModels.cs +++ b/Project-Unite/Models/WikiModels.cs @@ -99,7 +99,14 @@ public WikiPage[] AmbiguousReferences { var db = new ApplicationDbContext(); - return db.WikiPages.Where(w => w.Id != this.Id && w.Name.ToLower().Contains(this.Name.ToLower())).ToArray(); + var ambiguous1 = db.WikiPages.Where(w => w.Id != this.Id && w.Name.ToLower().Contains(this.Name.ToLower())).ToArray(); + var ambiguous2 = db.WikiPages.Where(w => w.Id != this.Id && this.Name.ToLower().Contains(w.Name.ToLower())).ToArray(); + + var list = new List(); + list.AddRange(ambiguous1); + list.AddRange(ambiguous2); + + return list.ToArray(); } } diff --git a/Project-Unite/Views/Wiki/Index.cshtml b/Project-Unite/Views/Wiki/Index.cshtml index 4b25bea..38cac11 100644 --- a/Project-Unite/Views/Wiki/Index.cshtml +++ b/Project-Unite/Views/Wiki/Index.cshtml @@ -56,6 +56,18 @@ {

@Model.Page.Name

+ if(Model.Page.AmbiguousReferences.Length > 0) + { +

Ambiguity detected. Here's a list of pages that may relate to this page.

+ + + } + var edit = Model.Page.EditHistory.First();

Last edited by @Html.UserLink(edit.UserId) on @edit.EditedAt