Created
October 4, 2012 08:17
-
-
Save koistya/3832162 to your computer and use it in GitHub Desktop.
Service locator in Windows Workflow Foundation
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
| public sealed class SampleActivity : CodeActivity | |
| { | |
| protected override void CacheMetadata(CodeActivityMetadata metadata) | |
| { | |
| // Require the IDatabaseContext extension to be defined in the workflow host application. | |
| // The workflow will fail validation if an extension with this interface is not provided. | |
| metadata.RequireExtension<IDatabaseContext>(); | |
| } | |
| protected override void Execute(CodeActivityContext context) | |
| { | |
| var db = context.GetExtension<IDatabaseContext>(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment