Skip to content

Commit

Permalink
Fixed CSV class map predicate
Browse files Browse the repository at this point in the history
Changing the company name in 48cb49f accidnetly broke code that depended on the company name.
  • Loading branch information
atruskie committed Apr 24, 2018
1 parent 48cb49f commit 164b031
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Acoustics.Shared/Csv/Csv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 164b031

Please sign in to comment.