コード例 #1
0
        protected override IReadOnlyCollection <ContentHolderModel> Handle(GetAllContentHoldersQuery request)
        {
            EnsureArg.IsNotNull(request);

            var contentHolders      = contentHolderRepository.GetAll();
            var mappedContentHolder = mapper.Map <IReadOnlyCollection <ContentHolderModel> >(contentHolders);

            return(mappedContentHolder);
        }
コード例 #2
0
        protected override Result <ContentHolderDetailsModel> Handle(GetContentHolderQuery request)
        {
            EnsureArg.IsNotNull(request);

            Maybe <Domain.ContentHolder> contentHolder = contentHolderRepository
                                                         .GetAll()
                                                         .FirstOrDefault(x => x.OriginId == request.ContentHolderOriginId);

            return(contentHolder.ToResult("Content holder not found!")
                   .Map(x => mapper.Map <ContentHolderDetailsModel>(x)));
        }