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()); }
public virtual Task DeleteAsync(Edition edition) { return EditionRepository.DeleteAsync(edition); }
public virtual Task CreateAsync(Edition edition) { return EditionRepository.InsertAsync(edition); }
/// <summary> /// 删除版本 /// </summary> /// <param name="edition"></param> /// <returns></returns> public virtual Task DeleteAsync(Edition edition) { return(EditionRepository.DeleteAsync(edition)); }
/// <summary> /// 创建版本 /// </summary> /// <param name="edition"></param> /// <returns></returns> public virtual Task CreateAsync(Edition edition) { return(EditionRepository.InsertAsync(edition)); }