Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Question: Adding custom selectors in datatypes to display multiple field values per line in dropdowns.

$
0
0
It should be doable to do a join like this
var allSubjects = connection.Get<University.Subjects>();
var allEducationLevels = connection.Get<University.EducationLevels>();

var joined = from subject in allSubjects
                    join educationLevel in allEducationLevels on subject.SubjectLevel equals educationLevel.Id
                    select new { Subject = subject, EducationLevel = educationLevel.EducationLevel };

var allSubjects = joined.ToDictionary(o => o.Subject.Id.ToString(), o => o.EducationLevel + " - " + o.Subject.SubjectName);
Regarding ordering, you can do that after the join like this
var joined = from subject in allSubjects
                    join educationLevel in allEducationLevels on subject.SubjectLevel equals educationLevel.Id
                    orderby subject.SubjectLevel, subject.SubjectName
                    select new { Subject = subject, EducationLevel = educationLevel.EducationLevel };

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>