Created
February 1, 2014 00:19
-
-
Save bhameyie/8746042 to your computer and use it in GitHub Desktop.
Sample Metadata for ASP.NET WebAPi service composition
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
[Export(typeof(IComposableApiMetadata))] | |
public class ExternalApiMetadata : IComposableApiMetadata { | |
public void Compose(ContainerBuilder builder) { | |
builder.Register(e => new BookRepository()).As<IBookRepository>().InstancePerApiRequest(); | |
} | |
public Assembly ApiAssembly() { | |
return typeof(BooksController).Assembly; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment