Esempio n. 1
0
        public static Optional <TEntity> Get <TKey, TEntity>(this IAtomicEntityReader <TKey, TEntity> self, TKey key)
        {
            TEntity entity;

            if (self.TryGet(key, out entity))
            {
                return(entity);
            }
            return(Optional <TEntity> .Empty);
        }
Esempio n. 2
0
        public static TEntity Load <TKey, TEntity>(this IAtomicEntityReader <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);
        }
Esempio n. 3
0
 public ReadModelFacade(IAtomicEntityReader<Guid, InventoryItemDetailsDto> entityReader, IAtomicSingletonReader<InventoryItems> singletonReader)
 {
     this.entityReader = entityReader;
     this.singletonReader = singletonReader;
 }