public async Task AddDictionaryToSection(Guid dictionaryId, Guid sectionId) { var item = new SectionDictionary() { DictionaryId = dictionaryId, SectionId = sectionId }; await _context.SectionDictionaries.AddAsync(item); }
public async Task AddDictionaryToSection(Dictionary dictionary, Section section) { var item = new SectionDictionary() { DictionaryId = dictionary.Id, SectionId = section.Id }; await _context.SectionDictionaries.AddAsync(item); }
/// <summary> /// Registers a code block in a dynamic section. /// </summary> /// <param name="httpContext">HttpContext instance.</param> /// <param name="dynamicSectionName">Name of the dynamic section where this block will be registered.</param> /// <param name="key">Key name. If it exists, the previous block will be overwritten.</param> /// <param name="content">Content to be registered.</param> public static void RegisterBlock(this HttpContext httpContext, string dynamicSectionName, string key, string content) { var sections = (SectionDictionary)httpContext.Items[HttpContextItemName]; if (sections == null) { sections = new SectionDictionary(); httpContext.Items[HttpContextItemName] = sections; } dynamicSectionName = dynamicSectionName ?? string.Empty; key = key ?? string.Empty; if (!sections.ContainsKey(dynamicSectionName)) { sections[dynamicSectionName] = new BlockDictionary(); } sections[dynamicSectionName][key] = content; }
private static string GetSectionAndRemoveWhenRequested(SectionDictionary sections, bool remove, params string[] sectionNames) { var sb = new StringBuilder(); foreach (var sectionName in sectionNames) { var contents = sections[sectionName].Select(c => c.Value); foreach (var content in contents) { sb.Append(content); } if (remove) // This section can be obtained only once! { sections.Remove(sectionName); } } return(sb.ToString()); }
internal AudioStream(SectionDictionary values) : base(values) { }
internal GeneralStream(SectionDictionary values) : base(values) { }
internal VideoStream(SectionDictionary values) : base(values) { }