Created
March 16, 2017 21:38
-
-
Save hakant/c4c29c9d6e98fb3a85c674a4b0ad6b28 to your computer and use it in GitHub Desktop.
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
import { CommandHandler } from "../infrastructure/command-handler" | |
import container from "../infrastructure/command-handler-container"; | |
class TestHandler implements CommandHandler<TestRequest, TestResponse> { | |
Handle(request: TestRequest): TestResponse { | |
var result = new TestResponse(); | |
result.message = `Hello ${request.name}!`; | |
return result; | |
} | |
} | |
export class TestRequest { | |
name: string; | |
} | |
export class TestResponse { | |
message: string; | |
} | |
let testHandler = new TestHandler(); | |
container.RegisterHandler(TestRequest, testHandler); | |
export default testHandler; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment