Exemplo n.º 1
0
        public async Task <LicenseDto> GetLicense()
        {
            var x = new LicenseDto();

            x.License = await LicenseContext.GetLicense();

            return(x);
        }
Exemplo n.º 2
0
        public async Task <LicenseDto> GetLicense([FromBody] LicenseDto data)
        {
            var license = data.License;

            if (await LicenseContext.CheckIfValid(license))
            {
                await LicenseContext.SaveLicense(license);

                return(await GetLicense());
            }

            throw new WebApiException("InvalidLicense", ExceptionSeverity.Error);
        }