Created
September 3, 2013 01:21
-
-
Save bhameyie/6418707 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.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