コード例 #1
0
        public DtoUpdateWriter Handle(WriterUpdateQuery query)
        {
            var writer = _writerQueryRepository.Get(query.Id);

            if (writer == null)
            {
                return(null);
            }
            return(new DtoUpdateWriter()
            {
                Name = writer.Name,
                PhotoId = writer.PhotoId,
                PhotoUrl = (writer.Photo == null)? null: writer.Photo.Url,
            });
        }
コード例 #2
0
        public DtoWriterDetail Handle(WriterDetailQuery query)
        {
            var writer = _writerQueryRepository.Get(query.Id);

            if (writer == null)
            {
                return(null);
            }
            return(new DtoWriterDetail()
            {
                Id = writer.Id,
                Name = writer.Name,
                Contents = writer.Contents,
                PhotoUrl = (writer.Photo == null)? null:writer.Photo.Url,
            });
        }