private static Dictionary <string, List> LoadLists(IIdGenerator idGenerator, IDobihFile dobihFile, IListInfoProvider listInfoProvider) { return(dobihFile.Records .SelectMany(x => x.Lists) .Distinct() .ToDictionary(listCode => listCode, listCode => CreateList(listCode, idGenerator, listInfoProvider)) .Where(x => x.Value.Enabled) .ToDictionary(x => x.Key, x => x.Value)); }
public SectionProvider(IIdGenerator idGenerator, IDobihFile dobihFile) { _sections = LoadSections(idGenerator, dobihFile); }
private static Dictionary <string, Section> LoadSections(IIdGenerator idGenerator, IDobihFile dobihFile) { return(dobihFile.Records .Select(x => new { x.SectionCode, x.SectionName }) .GroupBy(x => x.SectionName) .OrderBy(x => x.First().SectionCode) .ToDictionary( x => x.First().SectionName, x => new Section { Id = idGenerator.Generate(), Name = x.First().SectionName })); }
public ListProvider(IIdGenerator idGenerator, IDobihFile dobihFile, IListInfoProvider listInfoProvider) { _lists = LoadLists(idGenerator, dobihFile, listInfoProvider); }