diff --git a/examples/src/DapperExample/Program.cs b/examples/src/DapperExample/Program.cs index 66562eab..bcb1b051 100644 --- a/examples/src/DapperExample/Program.cs +++ b/examples/src/DapperExample/Program.cs @@ -4,25 +4,24 @@ using Ydb.Sdk.Ado; // Init Users table -await using var connection = await new YdbDataSource().OpenConnectionAsync(); -await connection.OpenAsync(); - -connection.ExecuteAsync(""" - CREATE TABLE Users( - Id Int32, - Name Text, - Email Text, - PRIMARY KEY (Id) - ); - """); - -connection.ExecuteAsync("INSERT INTO Users(Id, Name, Email) VALUES ($Id, $Name, $Email)", +using var connection = new YdbDataSource().OpenConnection(); + +connection.Execute(""" + CREATE TABLE Users( + Id Int32, + Name Text, + Email Text, + PRIMARY KEY (Id) + ); + """); + +connection.Execute("INSERT INTO Users(Id, Name, Email) VALUES ($Id, $Name, $Email)", new User { Id = 1, Name = "Name", Email = "Email" }); -Console.WriteLine(connection.QuerySingleAsync("SELECT * FROM Users WHERE Id = $Id", +Console.WriteLine(connection.QuerySingle("SELECT * FROM Users WHERE Id = $Id", new { Id = 1 })); -await connection.ExecuteAsync("DROP TABLE Users"); +connection.Execute("DROP TABLE Users"); internal class User {