private IEnumerable <FormulationMappingDTO> createFormulationMapping() { if (_protocol == null) { return(Enumerable.Empty <FormulationMappingDTO>()); } return((from usedFormulationKey in _protocol.UsedFormulationKeys where !usedFormulationKey.IsNullOrEmpty() let applicationType = _protocol.ApplicationTypeUsing(usedFormulationKey) let formulation = formulationUsedInSimulationFor(applicationType, usedFormulationKey) ?? defaultFormulationFor(applicationType, usedFormulationKey) select new FormulationMappingDTO { Selection = selectionFrom(formulation), ApplicationType = applicationType, FormulationKey = usedFormulationKey }).ToList()); }