public async Task <LinkTicketDto> AddAsync(string originalUrl) { var model = new LinkTicket(originalUrl); await _repository.InsertAsync(model); var result = ToModel(model); return(result); }
private LinkTicketDto ToModel(LinkTicket model) { var result = new LinkTicketDto { Domain = model.Domain, OriginalUrl = model.OriginalUrl, Id = model.Id, ShortenUrl = model.ShortenUrl, VisitedCount = model.VisitedCount }; return(result); }