private static object GetCellValue(DeclaredProperty prop, object target) { switch (prop) { case var _ when prop.ExcelReducer != null: return(prop.ExcelReducer((dynamic)target)); case var _ when prop.Type.IsEnum: return(prop.GetValue(target)?.ToString()); default: return(prop.GetValue(target)); } }
private static object GetCellValue(DeclaredProperty prop, object target) => prop switch {