Created
February 2, 2017 19:50
-
-
Save sitefinitysteve/0f4911a382b79e86735e8b3302f09f73 to your computer and use it in GitHub Desktop.
Coderush for Roslyn: ServiceStack Sitefinity Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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