Esempio n. 1
0
        public ResponseModel <bool> Put([FromBody] LicenseModel licenseModel)
        {
            var resp = new ResponseModel <bool>();

            try
            {
                if (licenseModel == null)
                {
                    throw new Exception("Data is null");
                }

                var id = licenseModel.Id;

                if (id <= 0)
                {
                    throw new Exception("Id license <= 0");
                }

                resp.Data = AppRepo.EditLicense(id, licenseModel);

                resp.Status      = 200;
                resp.Description = "OK";
            }
            catch (Exception ex)
            {
                resp.Status      = 500;
                resp.Description = $"Error: {ex.Message}";
                resp.Data        = false;
            }

            return(resp);
        }