示例#1
0
 public static Topic Create(AcademicBenchmarkConnector.Models.Topic topic)
 {
     return(new Topic
     {
         Id = topic.Id,
         Description = topic.Description,
         IsDeepest = topic.IsDeepest,
         Level = topic.Level,
         IsActive = topic.IsActive,
         ParentId = topic.Parent?.Id,
         SubjectDocument = SubjectDocument.Create(topic.SubjectDocument),
         Course = Course.Create(topic.Course)
     });
 }
示例#2
0
 public static Topic Map(AcademicBenchmarkConnector.Models.Topic model)
 {
     return(new Topic
     {
         Id = model.Id,
         Description = model.Description,
         IsActive = model.IsActive,
         CourseRef = model.Course.Id,
         IsDeepest = model.IsDeepest,
         ParentRef = model.Parent?.Id,
         AdoptYear = int.Parse(model.AdoptYear),
         // We need broad, because subjects have sub tree, and we don't
         // know about child subjects anything. So we take parent subject
         SubjectRef = model.Subject.Broad, //!!!
         GradeLevelHiRef = model.GradeLevel.High,
         GradeLevelLoRef = model.GradeLevel.Low,
         Level = model.Level,
         SubjectDocRef = model.SubjectDocument.Id
     });
 }