public async Task UpdateAsync(Models.ShortenUrl model)
        {
            await Validate(model);

            var efModel = _mapper.Map <EF.ShortenUrl>(model);
            await _repo.UpdateAsync(efModel);
        }
        public async Task <Guid> CreateAsync(Models.ShortenUrl model)
        {
            await Validate(model);

            var efModel = _mapper.Map <EF.ShortenUrl>(model);

            return(await _repo.CreateAsync(efModel));
        }
        private async Task Validate(Models.ShortenUrl model)
        {
            var shortcutValid = await _validator.IsShortcutValidAsync(model.Shortcut);

            if (!shortcutValid)
            {
                throw new ArgumentException("Shortcut is already used");
            }

            var urlValid = await _validator.IsUrlValidAsync(model.Url);

            if (!urlValid)
            {
                throw new ArgumentException("Url is not valid");
            }
        }