Last active
April 4, 2016 21:50
-
-
Save dcomartin/a776c018fed567a96fda087719bb0f0b 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
public abstract class AggregateRoot | |
{ | |
private IList<Guid> Operations { get; } = new List<Guid>(); | |
public void SetOperation(Guid operationId) | |
{ | |
if (Operations.Contains(operationId)) throw new InvalidOperationException("Duplicate Operation."); | |
Operations.Add(operationId); | |
} | |
} | |
public class Customer : AggregateRoot | |
{ | |
private Guid _customerId; | |
private string _name; | |
private Region _region; | |
private bool _active; | |
private PricingLevel _pricingLevel; | |
public void ChangePricingLevel(PricingLevel pricingLevel) | |
{ | |
_pricingLevel = pricingLevel; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment