예제 #1
0
        public async Task <ZippedLinkModel> ZipLink(ZipLinkDTO dto)
        {
            new ZipLinkValidator(dto).Validate();
            var newEntity = new ZippedLinkEntity()
            {
                Created      = DateTime.Now,
                Followed     = 0,
                OriginalLink = dto.Link,
                Hash         = _urlGenerator.Generate()
            };
            await _zippedLinksRepository.CreateLink(newEntity);

            return(newEntity.ConvertTo <ZippedLinkModel>());
        }
예제 #2
0
 public ZipLinkValidator(ZipLinkDTO dto)
 {
     DTO = dto;
 }