public IAmAMessageStoreViewer <Message> GetStoreViewer(string storeName, out ViewModelRetrieverResult <MessageListModel, MessageListModelError> errorResult)
        {
            IAmAMessageStore <Message> foundStore = _messageStoreViewerFactory.Connect(storeName);

            if (foundStore == null)
            {
                {
                    errorResult = new ViewModelRetrieverResult <MessageListModel, MessageListModelError>(
                        MessageListModelError.StoreNotFound);
                    return(null);
                }
            }
            var foundViewer = foundStore as IAmAMessageStoreViewer <Message>;

            if (foundViewer == null)
            {
                {
                    errorResult = new ViewModelRetrieverResult <MessageListModel, MessageListModelError>(
                        MessageListModelError.StoreMessageViewerNotImplemented);
                    return(null);
                }
            }
            errorResult = null;
            return(foundViewer);
        }
        private IAmAMessageStore <Message> GetMessageStoreFromConfig(RepostCommand command)
        {
            IAmAMessageStore <Message> messageStore = _messageStoreViewerFactory.Connect(command.StoreName);

            if (messageStore == null)
            {
                throw new Exception("Error " + RepostCommandHandlerError.StoreNotFound);
            }
            return(messageStore);
        }
Exemple #3
0
        private IAmAMessageStore <Message> GetStoreViewer(string storeName, out ViewModelRetrieverResult <MessageStoreViewerModel, MessageStoreViewerModelError> errorResult)
        {
            IAmAMessageStore <Message> foundStore = _storeViewerFactory.Connect(storeName);

            if (foundStore == null)
            {
                {
                    errorResult = new ViewModelRetrieverResult <MessageStoreViewerModel, MessageStoreViewerModelError>(
                        MessageStoreViewerModelError.StoreNotFound);
                    return(null);
                }
            }
            errorResult = null;
            return(foundStore);
        }