Ejemplo n.º 1
0
 public async Task CreateOrUpdateEdition(CreateOrUpdateEditionDto input)
 {
     if (!input.Edition.Id.HasValue)
     {
         await CreateEditionAsync(input);
     }
     else
     {
         await UpdateEditionAsync(input);
     }
 }
Ejemplo n.º 2
0
        protected virtual async Task UpdateEditionAsync(CreateOrUpdateEditionDto input)
        {
            Debug.Assert(input.Edition.Id != null, "input.Edition.Id should be set.");

            var edition = await _editionManager.GetByIdAsync(input.Edition.Id.Value);
            edition.DisplayName = input.Edition.DisplayName;

            await SetFeatureValues(edition, input.FeatureValues);
        }
Ejemplo n.º 3
0
        protected virtual async Task CreateEditionAsync(CreateOrUpdateEditionDto input)
        {
            var edition = new Edition(input.Edition.DisplayName);

            await _editionManager.CreateAsync(edition);
            await CurrentUnitOfWork.SaveChangesAsync(); //It's done to get Id of the edition.

            await SetFeatureValues(edition, input.FeatureValues);
        }