public async Task <Guid> CreateLicenseTokenFeature(Guid licenseTokenId, Guid productFeatureId, string featureValue)
        {
            return(await unitOfWork.RunInTransactionAsync(async() =>
            {
                var licenseToken = await licenseRepository.GetLicenseToken(licenseTokenId);
                var productFeature = await licenseRepository.GetProductFeature(productFeatureId);

                var entity = new LicenseTokenFeatureEntity
                {
                    Active = true,
                    ProductFeature = productFeature,
                    LicenseToken = licenseToken,
                    Value = featureValue
                };

                await licenseRepository.CreateLicenseTokenFeature(entity);

                // Update license tocken
                licenseToken.LicenseTokenFeatures.Add(entity);
                await licenseRepository.UpdateLicenseToken(licenseToken);

                return entity.Id;
            }));
        }
Example #2
0
 internal async Task CreateLicenseTokenFeature(LicenseTokenFeatureEntity entity)
 {
     await CreateAsync(entity);
 }