public static InterventionDTO MapToDto(this InterventionModelv3 a)
        {
            // TODO Map missing fields

            return(new InterventionDTO
            {
                //AppropriateGradeLevels = a.AppropriateGradeLevels,
                //AppropriateSexes = a.AppropriateSexes,
                BeginDate = a.BeginDate,
                EndDate = a.EndDate,
                ClassType = a.InterventionClassDescriptor?.MapToInterventionClassTypeV2(),
                DeliveryMethodType = a.DeliveryMethodDescriptor?.MapToDeliveryMethodTypeV2(),
                //Diagnoses = a.Diagnoses,
                //EducationContents = a.EducationContents,
                //EducationOrganizationReference = a.EducationOrganizationReference,
                //EndDate = a.BeginDate, // TODO Check if v3 has EndDate
                Id = a.Id,
                IdentificationCode = a.InterventionIdentificationCode,
                //InterventionPrescriptions = a.InterventionPrescriptions,
                //LearningResourceMetadataURIs = a.LearningResourceMetadataURIs,
                //MeetingTimes = a.MeetingTimes,
                //PopulationServeds = a.PopulationServeds,
                //Staffs = a.Staffs,
                //Uris = a.Uris,
                _Etag = a._etag,
            });
        }
 public static Intervention MapToInterventionV2(this InterventionModelv3 a)
 {
     return(new Intervention
     {
         AppropriateGradeLevels = a.AppropriateGradeLevels?.Select(b => b.MapToInterventionAppropriateGradeLevelsItemV2()).ToList(),
         AppropriateSexes = a.AppropriateSexes?.Select(b => b.MapToInterventionAppropriateSexesItemV2()).ToList(),
         BeginDate = !string.IsNullOrWhiteSpace(a.BeginDate) ? DateTime.Parse(a.BeginDate) : new DateTime(),
         ClassType = a.InterventionClassDescriptor?.MapToInterventionClassTypeV2(),
         DeliveryMethodType = a.DeliveryMethodDescriptor?.MapToDeliveryMethodTypeV2(),
         Diagnoses = a.Diagnoses?.Select(b => b.MapToInterventionDiagnosesItemV2()).ToList(),
         EducationContents = a.EducationContents?.Select(b => b.MapToInterventionEducationContentsItemV2()).ToList(),
         EducationOrganizationReference = a.EducationOrganizationReference?.MapToInterventionEducationOrganizationReference(),
         EndDate = !string.IsNullOrWhiteSpace(a.EndDate) ? DateTime.Parse(a.EndDate) : new DateTime(),
         Id = a.Id,
         IdentificationCode = a.InterventionIdentificationCode,
         InterventionPrescriptions = a.InterventionPrescriptions?.Select(b => b.MapToInterventionInterventionPrescriptionsItem()).ToList(),
         LearningResourceMetadataURIs = a.LearningResourceMetadataURIs?.Select(b => b.MapToInterventionLearningResourceMetadataURIsItem()).ToList(),
         MeetingTimes = a.MeetingTimes?.Select(b => b.MapToInterventionMeetingTimesItem()).ToList(),
         PopulationServeds = a.PopulationServeds?.Select(b => b.MapToInterventionPopulationServedsItem()).ToList(),
         Staffs = a.Staffs?.Select(b => b.MapToInterventionStaffsItem()).ToList(),
         Uris = a.Uris?.Select(b => b.MapToInterventionUrisItem()).ToList(),
         _etag = a._etag,
     });
 }