Skip to content

Instantly share code, notes, and snippets.

View maurodx's full-sized avatar

Mauro Destro maurodx

View GitHub Profile
@maurodx
maurodx / NetworkEventsToNetwork
Created March 29, 2011 14:44
EventSourcing for RavenDB
[DisplayName("Aggregates/Network")]
public class NetworkEventsToNetwork : AbstractViewGenerator
{
public NetworkEventsToNetwork()
{
MapDefinition = docs => docs.Where(doc => doc["@metadata"]["Raven-Entity-Name"].ToString().Contains("Event"));
GroupByExtraction = source => source.Network;
ReduceDefinition = Reduce;
Indexes.Add("Network", FieldIndexing.NotAnalyzed);