maintenance: plugin refactoring
This commit is contained in:
@@ -16,6 +16,8 @@ namespace Disco.Services.Plugins
|
||||
{
|
||||
public PluginManifest Manifest { get; set; }
|
||||
public Controller HostController { get; set; }
|
||||
public UrlHelper Url { get; set; }
|
||||
|
||||
protected DiscoDataContext Database;
|
||||
private Lazy<WebHelper> plugin;
|
||||
protected WebHelper Plugin
|
||||
@@ -29,10 +31,7 @@ namespace Disco.Services.Plugins
|
||||
public PluginWebHandler()
|
||||
{
|
||||
plugin = new Lazy<WebHelper>(new Func<WebHelper>(() => new WebHelper(HostController.HttpContext, Manifest)));
|
||||
}
|
||||
|
||||
public void OnActionExecuting()
|
||||
{
|
||||
Database = new DiscoDataContext();
|
||||
Database.Configuration.LazyLoadingEnabled = false;
|
||||
}
|
||||
@@ -169,6 +168,19 @@ namespace Disco.Services.Plugins
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Status Codes
|
||||
|
||||
public ActionResult Ok()
|
||||
{
|
||||
return new HttpStatusCodeResult(System.Net.HttpStatusCode.OK);
|
||||
}
|
||||
public ActionResult Ok(string description)
|
||||
{
|
||||
return new HttpStatusCodeResult(System.Net.HttpStatusCode.OK, description);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Content
|
||||
public ActionResult Content(string content, string contentType, Encoding contentEncoding)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user