Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Coderush for Roslyn: ServiceStack Sitefinity Template
using System;
using System.Collections.Generic;
using System.Linq;
using Telerik.Sitefinity;
using Telerik.Sitefinity.Model;
using Telerik.Sitefinity.DynamicModules;
using Telerik.Sitefinity.Data.Linq.Dynamic;
using Telerik.Sitefinity.Services.Search;
using Telerik.Sitefinity.Utilities.TypeConverters;
using ServiceStack.Text;
using ServiceStack;
using Telerik.Sitefinity.DynamicModules.Model;
namespace «FieldStart»«TextLink("MyNamespace")»«FieldEnd» {
#region PLUGIN
public class «Link("Custom")»ServicePlugin : IPlugin
{
/// <summary>
/// Call this at SitefinityWebApp.App_Start.RegisterServiceStackRoutes
/// SystemManager.RegisterServiceStackPlugin(new «TextLink("MyNamespace")».«Link("Custom")»ServicePlugin());
/// </summary>
public void Register(IAppHost appHost)
{
appHost.RegisterService(typeof(«Link("Custom")»Service));
}
}
#endregion
#region SERVICE
public class «FieldStart»«Caret»«Link("Custom")»«BlockAnchor»«FieldEnd»Service : IService {
public object Any(«FieldStart»«Link("MyFirstRequest")»«FieldEnd» request) {
return "Hello World";
}
}
#endregion
#region REQUEST
[Route("/«FieldStart»«TextLink("route")»«FieldEnd»")]
public class «Link("MyFirstRequest")» : IReturn<string> {
public string Param1 { get; set; }
}
#endregion
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.