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 CustomerAddress | |
{ | |
public string Name { get; set; } | |
public string Address { get; set; } | |
public string City { get; set; } | |
public string State { get; set; } | |
public string Zip { get; set; } | |
} |
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 CustomerAddress | |
{ | |
public event DomainEvent NotifyObservers; | |
string _name; | |
public string Name | |
{ | |
get { return _name; } | |
set | |
{ |
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 UpdateCustomerAddressAfterChange : IDomainEventHandler<CustomerAddressChanged> | |
{ | |
readonly IRepository _repository; | |
public UpdateCustomerAddressAfterChange(IRepository repository) | |
{ | |
_repository = repository; | |
} | |
public void Handle(CustomerAddressChanged @event) |
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 CustomerAddress | |
{ | |
public event DomainEvent NotifyObservers; | |
string _name; | |
public string Name | |
{ | |
get { return _name; } | |
set | |
{ |
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
var customer = _repository.Get<Customer>(6543); | |
customer.CustomerAddress.Name = "some new name"; | |
//event processed to update this CustomerAddress instance |
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 BlingInterceptor : EmptyInterceptor | |
{ | |
readonly IBlingInitializer _blingInitializer; | |
public BlingInterceptor(IBlingInitializer blingInitializer) | |
{ | |
_blingInitializer = blingInitializer; | |
} | |
public override bool OnLoad(object entity, object id, object[] state, string[] propertyNames, NHibernate.Type.IType[] types) |
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 interface IObjectPropertyChangerActor<out T> | |
{ | |
IObjectPropertyChangerActor<T> With(Action<T> action); | |
IObjectPropertyChangerActor<T> And(Action<T> action); | |
} | |
public class ObjectPropertyChangerActor<T> : IObjectPropertyChangerActor<T> | |
{ | |
readonly T _objectToChange; |
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 Car | |
{ | |
public string Color { get; set; } | |
public string Model { get; set; } | |
public string Make { get; set; } | |
public string Year { get; set; } | |
} | |
public class given_an_object_property_changer_context | |
{ |
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 BusinessDayCalculator : IBusinessDayCalculator | |
{ | |
private readonly IHolidayProvider _holidayProvider; | |
public BusinessDayCalculator(IHolidayProvider holidayProvider) | |
{ | |
_holidayProvider = holidayProvider; | |
} | |
public DateTime AddBusinessDays(DateTime startDate, int businessDays) |
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 Monkey GetMonkeyById(int id) | |
{ | |
var monkey = _monkeyRepository.Get(id); | |
return monkey; | |
} |