Skip to content

Instantly share code, notes, and snippets.

@bhameyie
Created September 3, 2013 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhameyie/6418707 to your computer and use it in GitHub Desktop.
Save bhameyie/6418707 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Reflection;
using System.Text;
using Common;
using Funq;
using ServiceStack.ServiceHost;
using ServiceStack.ServiceInterface;
namespace ComposingService
{
public class AwesomeService : Service
{
public object Get(AwesomeRequest request)
{
return "Yes, you're awesome " + request.Name;
}
}
public class AwesomeRequest
{
public string Name { get; set; }
}
[Export(typeof(IComposobaleBootstrapper))]
public class Composer:IComposobaleBootstrapper
{
public void Compose(Container container, IServiceRoutes routes)
{
routes.Add<AwesomeRequest>("/awesome/{Name}");
}
public Assembly GetAssembly()
{
return typeof (AwesomeService).Assembly;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment