-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
108 lines (102 loc) · 3.49 KB
/
Program.cs
File metadata and controls
108 lines (102 loc) · 3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
using Example;
partial class Program
{
static async Task Main(string[] args)
{
if (args.Length > 0)
{
await RunExampleByName(args[0]);
return;
}
Console.WriteLine("=== Weaviate C# Client Examples ===\n");
Console.WriteLine("Choose an example to run:");
Console.WriteLine(" 1. Traditional Example (cats.json batch insert)");
Console.WriteLine(" 2. Product Catalog Example (filtering and search)");
Console.WriteLine(" 3. Dependency Injection Example");
Console.WriteLine(" 4. Multiple Clients Example");
Console.WriteLine(" 5. Different Configs Example");
Console.WriteLine(" 6. Configuration Example (from appsettings.json)");
Console.WriteLine(" 7. Lazy Initialization Example");
Console.WriteLine(" 8. Connect Helper Example");
Console.WriteLine();
Console.Write("Enter your choice (1-8): ");
var choice = Console.ReadLine();
await RunExampleByChoice(choice);
}
static async Task RunExampleByChoice(string? choice)
{
switch (choice)
{
case "1":
await TraditionalExample.Run();
break;
case "2":
await ProductCatalogExample.Run();
break;
case "3":
await DependencyInjectionExample.Run();
break;
case "4":
await MultipleClientsExample.Run();
break;
case "5":
await DifferentConfigsExample.Run();
break;
case "6":
await ConfigurationExample.RunAsync();
break;
case "7":
await LazyInitializationExample.RunAsync();
break;
case "8":
await ConnectHelperExample.RunAsync();
break;
default:
Console.WriteLine("Invalid choice. Running traditional example...");
await TraditionalExample.Run();
break;
}
}
static async Task RunExampleByName(string name)
{
switch (name.ToLower())
{
case "traditional":
await TraditionalExample.Run();
break;
case "products":
case "catalog":
await ProductCatalogExample.Run();
break;
case "di":
case "dependency-injection":
await DependencyInjectionExample.Run();
break;
case "multiple":
case "multiple-clients":
await MultipleClientsExample.Run();
break;
case "configs":
case "different-configs":
await DifferentConfigsExample.Run();
break;
case "configuration":
await ConfigurationExample.RunAsync();
break;
case "lazy":
case "lazy-init":
await LazyInitializationExample.RunAsync();
break;
case "connect":
case "connect-helper":
await ConnectHelperExample.RunAsync();
break;
default:
Console.WriteLine($"Unknown example: {name}");
Console.WriteLine(
"Available examples: traditional, products, di, multiple, configs, configuration, lazy, connect"
);
break;
}
}
}