Due to a customer who has their own tables in a Jiwa database I have created the necessary classes to support my own Auto Query with the help of the T4 templates in visual studio, and by following what the API plugin does I have been able to get it working below is the plugin class (I have left out the service, request query and response classes for brevity) and my question is simply whilst I realise the route must be added and the service must be registered i.e. the last two lines are needed, are the first three lines necessary given that the Web API plugin is already doing this or are they needed because there is no guarantee which plugin Jiwa will load first?
- Code: Select all
public class RESTAPIPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaRESTAPIPlugin
{
public ServiceStack.AutoQueryFeature AutoQueryFeature;
public void Configure(JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin, ServiceStack.ServiceStackHost AppHost, Funq.Container Container, JiwaApplication.Manager JiwaApplicationManager)
{
AppHost.Plugins.Add(new AutoQueryFeature() { EnableAutoQueryViewer = true, MaxLimit = 100 });
AppHost.Plugins.Add(new AutoQueryDataFeature { MaxLimit = 100 });
Container.Register<ServiceStack.Data.IDbConnectionFactory>(new OrmLiteConnectionFactory(JiwaApplicationManager.Database.ConnectionString, ServiceStack.OrmLite.SqlServer2012Dialect.Provider));
AppHost.RegisterService<CustomTermServices>();
AppHost.Routes.Add(typeof(HOS_CustomTermQuery), "/Queries/HOS_CustomTerm", "GET", "Retrieves Hos Custom Terms.", "");
}
}