Created
June 15, 2010 22:51
-
-
Save agross/439866 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
| public class DeathCaseCreatedSyncListener : IPostInsertEventListener | |
| { | |
| readonly IContributeDeathCaseDetails[] _properties; | |
| readonly ISyncService _syncService; | |
| public DeathCaseCreatedSyncListener(ISyncService syncService, | |
| IContributeDeathCaseDetails[] properties) | |
| { | |
| _syncService = syncService; | |
| _properties = properties; | |
| } | |
| public void OnPostInsert(PostInsertEvent @event) | |
| { | |
| var deathCase = @event.Entity as DeathCase; | |
| if (deathCase != null) | |
| { | |
| SendDeathCaseCreationSyncEvent(deathCase); | |
| } | |
| } | |
| void SendDeathCaseCreationSyncEvent(DeathCase deathCase) | |
| { | |
| var message = new DeathCaseCreatedMessage(); | |
| _properties.Each(x => x.Apply(deathCase, message)); | |
| _syncService.DeathCaseUpdated(message); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment