From 8363631f0fc02701ad8738b8c241b99e462fa1a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Miko=C5=82ajczyk?= <53557466+adimiko@users.noreply.github.com> Date: Wed, 7 Feb 2024 17:07:04 +0100 Subject: [PATCH] Update README.md --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ae22fb..6569cd5 100644 --- a/README.md +++ b/README.md @@ -1 +1,15 @@ -# TransactionContext \ No newline at end of file +# TransactionContext (Proof of concept) +TransactionContext is designed to execute statements changing state (also call to stored procedures) in a single transaction and a single request to database (collects SQL statements without instant execution). + +It can be an alternative for Entity Framework Core and TransactionScope in .NET. + +```sh +transactionContext.Add("INSERT INTO Customers (CustomerId) VALUES (@CustomerId)", new { CustomerId = Guid.NewGuid() }); +transactionContext.Add("INSERT INTO Orders (OrderId) VALUES (@OrderId)", new { OrderId = Guid.NewGuid() }); +``` + +`transactionContext.Commit()` open connection, create transaction and execute sql statments in a single database request. + +```sh +await transactionContext.Commit(); +```