- Code: Select all
#region CustomRoute
public class CustomRoute : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaRESTAPIPlugin
{
public void Configure(Plugin Plugin, ServiceStackHost AppHost, Container Container, Manager JiwaApplicationManager)
{
AppHost.RegisterService<CustomService>();
AppHost.Routes.Add(typeof(MyMart.Models.Order), "/MyMart/Orders", "POST", "add custom application order.", "");
}
}
#endregion
#region CustomService
public class CustomService : ServiceStack.Service
{
[Authenticate]
public string MyMartOrder(MyMart.Models.Order order)
{
return order.Id;
}
}
#endregion
This MyMartMdels.Order is coming referenced from the class library. I dont want to repeat that class also in the plugin because its contain 20-25 properties in it. I want to re-use it but I am getting the
- Code: Select all
{
"ResponseStatus": {
"ErrorCode": "NotImplementedException",
"Message": "Unable to resolve service 'Order'",
"StackTrace": " at ServiceStack.Host.ServiceController.GetService(Type requestType)\r\n at ServiceStack.Host.ServiceController.<ExecuteAsync>d__47.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at ServiceStack.Host.RestHandler.<ProcessRequestAsync>d__14.MoveNext()"
}
}