Example #1
0
        public IEnumerable <OrganeModel> Organes(string parentDir)
        {
            var tmp    = RawOrgane.FromDirectory(Path.Combine(parentDir, "organe"));
            var result = new List <OrganeModel>();

            foreach (var rawOrgane in tmp)
            {
                OrganeModel model;
                if (rawOrgane.CodeType == TypeOrgane.Gp)
                {
                    model = new GroupeParlementaireModel(rawOrgane);
                }
                else
                {
                    model = new OrganeModel(rawOrgane);
                }

                if (rawOrgane.OrganeParent != null && _modelStorage.Contains <OrganeModel>(rawOrgane.OrganeParent))
                {
                    model.Parent = _modelStorage.Get <OrganeModel>(rawOrgane.OrganeParent);
                }

                result.Add(model);
            }

            return(result);
        }