-
Notifications
You must be signed in to change notification settings - Fork 0
benjaminkeeping/OpenRasta.Routing
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This dll takes some of the pain away from registering routes in OpenRasta. It's on Nuget as "OpenRasta.Routing" So instead of registering routes like this : using (OpenRastaConfiguration.Manual) { ResourceSpace.Has.ResourcesOfType<object>() .AtUri("/foo/{id}").Named("view-foo") .HandledBy<FooHandler>() .AsJsonDataContract() .And.AsXmlDataContract(); } You can just call : using (OpenRastaConfiguration.Manual) { // Register all handler's routes in given assembly(s), and all model/wire types in given assembly(s) Routing.Register(typeof(FooHandler).Assembly, typeof(Foo).Assembly); } And then tag your handlers : public class FooHandler { [Get("/foo/{id}")] public OperationResult Foo() { return new OperationResult.OK { ResponseResource = new Foo() }; } There are attributes for Get, Post, Put, Patch and Delete
About
Register routes with OpenRasta using attributes on your handlers, instead of manually via OR configuration
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published