Esempio n. 1
0
        public async Task <IActionResult> Post([FromBody] LicenseRegisterRequest request)
        {
            if (request == null)
            {
                return(BadRequest());
            }

            var result = await _licenseService.CreateAsync(request, string.IsNullOrWhiteSpace(User.Identity.Name)?Environment.UserName : User.Identity.Name);

            return(Ok(result));
        }
Esempio n. 2
0
        public async Task <IActionResult> PostLicense(LicenseForCreationDto licenseForCreation)
        {
            var license = await _licenseService.CreateAsync(licenseForCreation);

            return(CreatedAtAction("GetLicense", new { id = license.Id }, license));
        }
 public async Task HandleAsync(CreateLicense command)
 => await _licenseService.CreateAsync(command.Id, command.CustomerId, command.IP, command.HWID, command.Key);