Created
August 29, 2012 17:15
-
-
Save yreynhout/3515757 to your computer and use it in GitHub Desktop.
Sample 1 - after
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
public class CurrentPortfolioProjection : | |
IHandle<AddedRealtyToPortfolio>, | |
IHandle<RemovedRealtyFromPortfolio> { | |
IProjectionSqlOperations<CurrentPortfolioEntry> _operations; | |
public CurrentPortfolioProjection(IProjectionSqlOperations<CurrentPortfolioEntry> operations) { | |
_operations = operations; | |
} | |
public void Handle(AddedRealtyToPortfolio @event) { | |
_operations.Insert( | |
new CurrentPortfolioEntry( | |
@event.PortfolioId, @event.RealtyId, | |
@event.RealtySummary, @event.RealtySlideshowUrl, | |
@event.RealtyPropertySheetUrl, @event.RealtyFloorPlanUrl)); | |
} | |
public void Handle(RemovedRealtyFromPortfolio @event) { | |
_operations.Delete(entry => | |
entry.PortfolioId == @event.PortfolioId && | |
entry.RealtyId == @event.RealtyId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment