-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathProgram.cs
40 lines (31 loc) · 999 Bytes
/
Program.cs
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
using System;
using System.Data.SqlClient;
using System.Threading.Tasks;
using System.Xml;
namespace PostSharp.Samples.StoredProcedure
{
internal class Program
{
public static async Task Main(string[] args)
{
using (SqlConnection connection = new SqlConnection(@"Data Source=.\SQLEXPRESS;Initial Catalog=PostSharpSamples;Integrated Security=True"))
{
await connection.OpenAsync();
SpeakerApi api = new SpeakerApi(connection);
Console.WriteLine("All speakers:");
foreach (var speaker in api.GetSpeakers())
{
Console.WriteLine(speaker);
}
Console.WriteLine("Disable speaker 1...");
await api.SetSpeakerStatusAsync(1, false);
Console.WriteLine("Active speakers:");
foreach (var speaker in api.GetActiveSpeakers())
{
Console.WriteLine(speaker);
}
// TODO: GetActiveSpeakersAsync does not work because of a bug in PostSharp.
}
}
}
}