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>()); }
public ZipLinkValidator(ZipLinkDTO dto) { DTO = dto; }