예제 #1
0
        public ViewModelRetrieverResult<MessageListModel, MessageListModelError> Get(string storeName, int pageNumber, int pageSize = 100)
        {
            ViewModelRetrieverResult<MessageListModel, MessageListModelError> errorResult;
            IAmAMessageStoreViewer<Message> foundViewer = GetStoreViewer(storeName, out errorResult);
            if (foundViewer == null) return errorResult;
            try
            {
                var messages = foundViewer.Get(pageSize, pageNumber).Result;
                var messageListModel = new MessageListModel(messages);

                return new ViewModelRetrieverResult<MessageListModel, MessageListModelError>(messageListModel);
            }
            catch (Exception e)
            {
                return new ViewModelRetrieverResult<MessageListModel, MessageListModelError>(MessageListModelError.StoreMessageViewerGetException, e);
            }
        }
 public FakeMessageListViewModelRetriever(MessageListModel fakeResultModel)
 {
     _fakeResultModel = fakeResultModel;
 }