diff --git a/src/Acoustics.Shared/Csv/Csv.cs b/src/Acoustics.Shared/Csv/Csv.cs index 0290717d6..090069092 100644 --- a/src/Acoustics.Shared/Csv/Csv.cs +++ b/src/Acoustics.Shared/Csv/Csv.cs @@ -44,14 +44,16 @@ static Csv() // Find all of our custom class maps var type = typeof(CsvClassMap); + + bool OurCodePredicate(Assembly a) + { + var assemblyCompanyAttribute = (AssemblyCompanyAttribute)a.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false).FirstOrDefault(); + return assemblyCompanyAttribute != null && assemblyCompanyAttribute.Company.Contains("QUT"); + } + var classMapTypes = AppDomain.CurrentDomain.GetAssemblies() - .Where( - a => - { - var assemblyCompanyAttribute = (AssemblyCompanyAttribute)a.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false).FirstOrDefault(); - return assemblyCompanyAttribute != null && assemblyCompanyAttribute.Company == "QUT"; - }) + .Where(OurCodePredicate) .SelectMany(s => s.GetTypes()) .Where(type.IsAssignableFrom);