private void BuildCountryProjector() { var countryMapBuilder = new EventMapBuilder <CountryLookup, string, RavenProjectionContext>(); countryMapBuilder .Map <CountryRegisteredEvent>() .AsCreateOf(anEvent => anEvent.Code) .Using((country, anEvent) => country.Name = anEvent.Name); countryProjector = new RavenChildProjector <CountryLookup>(countryMapBuilder, (lookup, key) => lookup.Id = key) { Cache = new LruProjectionCache <CountryLookup>(20000, TimeSpan.FromSeconds(30), TimeSpan.FromMinutes(2), p => p.Id, () => DateTime.UtcNow) }; }
private void BuildCountryProjector() { var countryMapBuilder = new EventMapBuilder <CountryLookup, string, RavenProjectionContext>(); countryMapBuilder .Map <CountryRegisteredEvent>() .AsCreateOf(anEvent => anEvent.Code) .Using((country, anEvent) => country.Name = anEvent.Name); countryProjector = new RavenChildProjector <CountryLookup>(countryMapBuilder) { Cache = cache }; }