Esempio n. 1
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);
        }
        private void CreateEditions()
        {
            var defaultEdition = _context.Editions.FirstOrDefault(e => e.Name == EditionManager.DefaultEditionName);
            if (defaultEdition == null)
            {
                defaultEdition = new Edition { Name = EditionManager.DefaultEditionName, DisplayName = EditionManager.DefaultEditionName };
                _context.Editions.Add(defaultEdition);
                _context.SaveChanges();

                //TODO: Add desired features to the standard edition, if wanted!
            }   
        }
 private Task SetFeatureValues(Edition edition, List<NameValueDto> featureValues)
 {
     return _editionManager.SetFeatureValuesAsync(edition.Id, featureValues.Select(fv => new NameValue(fv.Name, fv.Value)).ToArray());
 }
Esempio n. 4
0
 public virtual Task DeleteAsync(Edition edition)
 {
     return EditionRepository.DeleteAsync(edition);
 }
Esempio n. 5
0
 public virtual Task CreateAsync(Edition edition)
 {
     return EditionRepository.InsertAsync(edition);
 }
Esempio n. 6
0
 /// <summary>
 /// 删除版本
 /// </summary>
 /// <param name="edition"></param>
 /// <returns></returns>
 public virtual Task DeleteAsync(Edition edition)
 {
     return(EditionRepository.DeleteAsync(edition));
 }
Esempio n. 7
0
 /// <summary>
 /// 创建版本
 /// </summary>
 /// <param name="edition"></param>
 /// <returns></returns>
 public virtual Task CreateAsync(Edition edition)
 {
     return(EditionRepository.InsertAsync(edition));
 }