Exemple #1
0
 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));
 }
Exemple #2
0
 public SectionProvider(IIdGenerator idGenerator, IDobihFile dobihFile)
 {
     _sections = LoadSections(idGenerator, dobihFile);
 }
Exemple #3
0
 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
     }));
 }
Exemple #4
0
 public ListProvider(IIdGenerator idGenerator, IDobihFile dobihFile, IListInfoProvider listInfoProvider)
 {
     _lists = LoadLists(idGenerator, dobihFile, listInfoProvider);
 }