示例#1
0
        public void SaveLicense(string productName, ProductLicense license)
        {
            if (String.IsNullOrEmpty(productName))
            {
                throw new ArgumentNullException("ProductName is null or empty.");
            }

            if (license == null)
            {
                throw new ArgumentNullException("ProductLicense is null.");
            }

            if (license.LicenseInfo == null)
            {
                throw new InvalidOperationException("ProductLicense is not valid and can't be saved.");
            }

            _licenseStore.SaveLicense(productName, license.LicenseInfo);
        }