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
protected override ValidationResults OnValidate(PurchaseTransaction purchaseTransaction) | |
{ | |
return purchaseTransaction | |
.With(ValidationCheck) | |
.Unless(IsValidateServiceDown) | |
.Try(SendMessageToTransecure) | |
.InCaseOfException(MarkServiceAsDown) | |
.Return(TheResult, OrFailureCodeInCaseOfFailure); | |
} |
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
[Test] | |
public void NHibernate_allows_crud_operations() | |
{ | |
Create(); | |
Read(); | |
Update(); | |
Delete(); | |
} | |
private void Create() |
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
//Customer is an aggregate root | |
public class Customer : AggregateRootMappedByConvention | |
{ | |
//Customer contains orders, each of which is uniquely identified hence is an entity | |
private readonly List<Order> _orders = new List<Order>(); | |
public void CreateOrder(int id) | |
{ | |
//Does not create an entity, only publishes event. | |
//The entity has localy unique id. Its uniqueness is ensured here. |
NewerOlder