public async Task <bool> UpdateAsync(Guid id, LicenseForUpdateDto licenseForUpdate)
        {
            var license = await _repositoryManager.License.GetLicenseAsync(CurrentUserId, id, true);

            if (license == null)
            {
                _logger.LogWarning("There is no license with {Id}", id);
                return(false);
            }

            _mapper.Map(licenseForUpdate, license);
            _repositoryManager.License.UpdateLicense(license);
            await _repositoryManager.SaveAsync();

            return(true);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> PutLicense(Guid id, LicenseForUpdateDto licenseForUpdate)
        {
            var license = await _licenseService.UpdateAsync(id, licenseForUpdate);

            return(license ? NoContent() : NotFound());
        }