public static Optional <TEntity> Get <TKey, TEntity>(this IAtomicReader <TKey, TEntity> self, TKey key) { TEntity entity; if (self.TryGet(key, out entity)) { return(entity); } return(Optional <TEntity> .Empty); }
public static Optional <TSingleton> Get <TSingleton>(this IAtomicReader <unit, TSingleton> reader) { TSingleton singleton; if (reader.TryGet(unit.it, out singleton)) { return(singleton); } return(Optional <TSingleton> .Empty); }
public static TView GetOrNew <TView>(this IAtomicReader <unit, TView> reader) where TView : new() { TView view; if (reader.TryGet(unit.it, out view)) { return(view); } return(new TView()); }
public static TEntity Load <TKey, TEntity>(this IAtomicReader <TKey, TEntity> self, TKey key) { TEntity entity; if (self.TryGet(key, out entity)) { return(entity); } var txt = string.Format("Failed to load '{0}' with key '{1}'.", typeof(TEntity).Name, key); throw new InvalidOperationException(txt); }
public RecipeProvider(IAtomicReader<RecipeId, RecipeView> reader, IAtomicReader<unit, RecipeByNameIndex> indexReader) { this.reader = reader; this.indexReader = indexReader; }
public HeatMapRequestHandler(IAtomicReader<unit, HeatMapView> reader ) { _reader = reader; }
public HeatMapGenerateTask(IAtomicReader <unit, PointsView> reader, IAtomicWriter <unit, HeatMapView> mapWriter) { _reader = reader; _mapWriter = mapWriter; }
public RecipeProvider(IAtomicReader <RecipeId, RecipeView> reader, IAtomicReader <unit, RecipeByNameIndex> indexReader) { this.reader = reader; this.indexReader = indexReader; }
public HeatMapRequestHandler(IAtomicReader <unit, HeatMapView> reader) { _reader = reader; }