File tree 2 files changed +20
-4
lines changed
docs/samples/Microsoft.ML.Samples
2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 4
4
<TargetFramework >netcoreapp2.1</TargetFramework >
5
5
<OutputType >Exe</OutputType >
6
6
<SignAssembly >false</SignAssembly >
7
+ <!-- This ensures that we can never make the mistake of adding this as a friend assembly. Please don't remove.-->
7
8
<PublicSign >false</PublicSign >
8
9
<RootNamespace >Samples</RootNamespace >
9
10
</PropertyGroup >
Original file line number Diff line number Diff line change 1
- using Samples . Dynamic ;
1
+ using System ;
2
+ using System . Reflection ;
2
3
3
4
namespace Microsoft . ML . Samples
4
5
{
5
- internal static class Program
6
+ public static class Program
6
7
{
7
- static void Main ( string [ ] args )
8
+ public static void Main ( string [ ] args ) => RunAll ( ) ;
9
+
10
+ internal static void RunAll ( )
8
11
{
9
- CalculateFeatureContribution . Example ( ) ;
12
+ int samples = 0 ;
13
+ foreach ( var type in Assembly . GetExecutingAssembly ( ) . GetTypes ( ) )
14
+ {
15
+ var sample = type . GetMethod ( "Example" , BindingFlags . Public | BindingFlags . Static | BindingFlags . FlattenHierarchy ) ;
16
+
17
+ if ( sample != null )
18
+ {
19
+ sample . Invoke ( null , null ) ;
20
+ samples ++ ;
21
+ }
22
+ }
23
+
24
+ Console . WriteLine ( "Number of samples that ran without any exception: " + samples ) ;
10
25
}
11
26
}
12
27
}
You can’t perform that action at this time.
0 commit comments