Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

querymultiple dapper c#

string sql = "SELECT * FROM Invoice WHERE InvoiceID = @InvoiceID; SELECT * FROM InvoiceItem WHERE InvoiceID = @InvoiceID;";

using (var connection = My.ConnectionFactory())
{
    connection.Open();

    using (var multi = connection.QueryMultiple(sql, new {InvoiceID = 1}))
    {
        var invoice = multi.Read<Invoice>().First();
        var invoiceItems = multi.Read<InvoiceItem>().ToList();
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity round to x decimals 
Csharp :: drag png to unity 3d 
Csharp :: c# swap variables 
Csharp :: blazor option selected 
Csharp :: unity making a coroutine wait until another coroutine is done 
Csharp :: take screenshot in c# 
Csharp :: how to encode and decode a string in c# 
Csharp :: c# odd even median 
Csharp :: get text component unity 
Csharp :: video gets pixelated by scaling it up to Screen Size unity 
Csharp :: c# OnMouseUp unity 
Csharp :: unity how to get the first word from string 
Csharp :: consecutive numbers c# 
Csharp :: c# palidrone 
Csharp :: how to use file watcher in c# 
Csharp :: make invisible unity 
Csharp :: c# compile just one exe 
Csharp :: .net core check if user is logged in 
Csharp :: how to create a list in c# unity 
Csharp :: c# get last item in list 
Csharp :: convert from xls to xlsx C# 
Csharp :: convert array object to int[] c# 
Csharp :: default generic parameter for method in c# 
Csharp :: c# regex get matched string 
Csharp :: parse json array c# 
Csharp :: rotating an object in unity 
Csharp :: c# print exception stack trace 
Csharp :: c# color hex 
Csharp :: yanderedev 
Csharp :: c# csv read write 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =