protected virtual async Task CreateEditionAsync(CreateEditionDto input) { var edition = ObjectMapper.Map <SubscribableEdition>(input.Edition); if (edition.ExpiringEditionId.HasValue) { var expiringEdition = (SubscribableEdition)await _editionManager.GetByIdAsync(edition.ExpiringEditionId.Value); if (!expiringEdition.IsFree) { throw new UserFriendlyException(L("ExpiringEditionMustBeAFreeEdition")); } } await _editionManager.CreateAsync(edition); await CurrentUnitOfWork.SaveChangesAsync(); //It's done to get Id of the edition. await SetFeatureValues(edition, input.FeatureValues); }
public async Task CreateEdition(CreateEditionDto input) { await CreateEditionAsync(input); }