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 static class ExpressionExtensions | |
{ | |
/// <summary> | |
/// Converts a lambda property getter expression to a property setter delegate. | |
/// For example: "o => o.MyProperty" to "o => o.MyProperty = newValue" | |
/// </summary> | |
public static Action<TProperty> ConvertGetterToSetter<TObject, TProperty>(this Expression<Func<TObject, TProperty>> expression, TObject o) { | |
var property = ((MemberExpression)expression.Body).Member as PropertyInfo; | |
Guard.Against(property == null, "Expression is not a property getter"); |
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
Notes based on Greg Young's business perspective presentation | |
http://skillsmatter.com/podcast/agile-testing/greg-young-cqrs-event-sourcing-the-business-perspective | |
With a standard structural model we make assumptions of what the business may or may not want in the future. How can we presume to know what to track and what to discard. | |
CQRS/ES benefits: | |
* Captures behaviour explicitly, events carry the intent of users. | |
* We can derive any possible model about data that may be required. | |
* Allows domain experts and users to look at today in any way they may want to. |
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
// NOTE: ripped from https://github.com/caelum/restfulie/wiki/csharp_short_samples | |
//retrieves the resource through GET: the entry point | |
dynamic order = Restfulie.At(resourceURI).Get(); | |
Console.WriteLine("the order price is " + order.Price); | |
Console.WriteLine("The order product is" + order.Product); | |
// Executing a state transition: | |
order.Pay(); |