private void AfterPluginsLoaded(string specifiedContentType) { if (!IsNullOrEmpty(specifiedContentType)) { config.DefaultContentType = specifiedContentType; } else if (IsNullOrEmpty(config.DefaultContentType)) { config.DefaultContentType = MimeTypes.Json; } Config.PreferredContentTypes.Remove(Config.DefaultContentType); Config.PreferredContentTypes.Insert(0, Config.DefaultContentType); Config.PreferredContentTypesArray = Config.PreferredContentTypes.ToArray(); foreach (var plugin in Plugins) { var preInitPlugin = plugin as IPostInitPlugin; if (preInitPlugin != null) { try { preInitPlugin.AfterPluginsLoaded(this); } catch (Exception ex) { OnStartupException(ex); } } } ServiceController.AfterInit(); }
public virtual ServiceStackHost Init() { Instance = this; ServiceController.Init(); Configure(); ServiceController.AfterInit(); return(this); }
private void AfterPluginsLoaded(string specifiedContentType) { if (!String.IsNullOrEmpty(specifiedContentType)) { config.DefaultContentType = specifiedContentType; } else if (String.IsNullOrEmpty(config.DefaultContentType)) { config.DefaultContentType = MimeTypes.Json; } ServiceController.AfterInit(); }
private void AfterPluginsLoaded(string specifiedContentType) { if (!String.IsNullOrEmpty(specifiedContentType)) { config.DefaultContentType = specifiedContentType; } else if (String.IsNullOrEmpty(config.DefaultContentType)) { config.DefaultContentType = MimeTypes.Json; } Config.PreferredContentTypes.Remove(Config.DefaultContentType); Config.PreferredContentTypes.Insert(0, Config.DefaultContentType); Config.PreferredContentTypesArray = Config.PreferredContentTypes.ToArray(); ServiceController.AfterInit(); }