示例#1
0
        public string AddLink(TinyLinkDto tinyLinkDto)
        {
            var tinyLink = _tinyLinkRepository.Get(tinyLinkDto.Hash);

            if (tinyLink == null)
            {
                TinyLinkEntity tinyLinkEntity = new TinyLinkEntity
                {
                    Link  = tinyLinkDto.Link,
                    Hash  = tinyLinkDto.Hash,
                    Count = 0
                };
                var hash = _tinyLinkRepository.Add(tinyLinkEntity);
                return(hash);
            }

            return(tinyLink.Hash);
        }
示例#2
0
 public string AddLink(TinyLinkDto tinyLinkDto)
 {
     return(_tinyLinkApplicationService.AddLink(tinyLinkDto));
 }