diff --git a/src/PopForums.Mvc/Areas/Forums/Controllers/ForumController.cs b/src/PopForums.Mvc/Areas/Forums/Controllers/ForumController.cs index cc7e7729..e20b018e 100644 --- a/src/PopForums.Mvc/Areas/Forums/Controllers/ForumController.cs +++ b/src/PopForums.Mvc/Areas/Forums/Controllers/ForumController.cs @@ -61,7 +61,7 @@ public async Task Index(string urlName, int pageNumber = 1) var adapter = new ForumAdapterFactory(forum); if (adapter.IsAdapterEnabled) { - adapter.ForumAdapter.AdaptForum(this, container); + await adapter.ForumAdapter.AdaptForum(this, container); if (string.IsNullOrWhiteSpace(adapter.ForumAdapter.ViewName)) return View(adapter.ForumAdapter.Model); return View(adapter.ForumAdapter.ViewName, adapter.ForumAdapter.Model); @@ -191,7 +191,7 @@ public async Task Topic(string id, int pageNumber = 1) container.TopicState = topicState; if (adapter.IsAdapterEnabled) { - adapter.ForumAdapter.AdaptTopic(this, container); + await adapter.ForumAdapter.AdaptTopic(this, container); if (string.IsNullOrWhiteSpace(adapter.ForumAdapter.ViewName)) return View(adapter.ForumAdapter.Model); return View(adapter.ForumAdapter.ViewName, adapter.ForumAdapter.Model); @@ -363,7 +363,7 @@ public async Task PostLink(int id) var adapter = new ForumAdapterFactory(forum); if (adapter.IsAdapterEnabled) { - var result = adapter.ForumAdapter.AdaptPostLink(this, post, topic, forum); + var result = await adapter.ForumAdapter.AdaptPostLink(this, post, topic, forum); if (result != null) return result; } diff --git a/src/PopForums.Mvc/Areas/Forums/Services/IForumAdapter.cs b/src/PopForums.Mvc/Areas/Forums/Services/IForumAdapter.cs index 2cfbd0b1..be9c4288 100644 --- a/src/PopForums.Mvc/Areas/Forums/Services/IForumAdapter.cs +++ b/src/PopForums.Mvc/Areas/Forums/Services/IForumAdapter.cs @@ -16,7 +16,7 @@ public interface IForumAdapter /// /// Instance of the controller calling the adapter. /// The composed ForumTopicContainer created by the Index method of the ForumController. - void AdaptForum(Controller controller, ForumTopicContainer forumTopicContainer); + Task AdaptForum(Controller controller, ForumTopicContainer forumTopicContainer); /// /// This method allows you to change the view and model generated by the Topic method of the ForumController by setting @@ -24,7 +24,7 @@ public interface IForumAdapter /// /// Instance of the controller calling the adapter. /// The composed TopicContainer created by the Topic method of the ForumController. - void AdaptTopic(Controller controller, TopicContainer topicContainer); + Task AdaptTopic(Controller controller, TopicContainer topicContainer); /// /// This method allows you to override the behavior of the ForumController's PostLink @@ -36,7 +36,7 @@ public interface IForumAdapter /// The topic associated with the post. /// The forum associated with the topic. /// - RedirectResult AdaptPostLink(Controller controller, Post post, Topic topic, Forum forum); + Task AdaptPostLink(Controller controller, Post post, Topic topic, Forum forum); /// /// Set this in the adapter for alternate views from the AdaptForum and AdaptTopic methods.