예제 #1
0
        public async Task <LinkTicketDto> AddAsync(string originalUrl)
        {
            var model = new LinkTicket(originalUrl);
            await _repository.InsertAsync(model);

            var result = ToModel(model);

            return(result);
        }
예제 #2
0
        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);
        }