Horje
Entity Framework Core 3.1 Return value (int) from stored procedure Code Example
Entity Framework Core 3.1 Return value (int) from stored procedure
int? quantity = 0;
var ticketParam = new SqlParameter("Ticket", ticket);
var referenceParam = new SqlParameter("Reference", reference);
var quantityParam = new SqlParameter("Quantity") { Direction = ParameterDirection.Output };
try
{
    await _context.Database.ExecuteSqlRawAsync("EXEC Production.Select_TicketQuantity @Ticket, @Reference, @Quantity output", new[] { ticketParam, referenceParam, quantityParam });
    quantity = Convert.ToInt32(quantityParam.Value);
}
catch (Exception ex)
{
    _logger.LogError($"{ex}");
    return RedirectToPage("Index");
}




Csharp

Related
c# catch multiple exceptions at once Code Example c# catch multiple exceptions at once Code Example
c# namespace name form1 could not be found Code Example c# namespace name form1 could not be found Code Example
No module named 'raplet' Code Example No module named 'raplet' Code Example
c# trimend substring Code Example c# trimend substring Code Example
total sales in array c++ two dimensional array Code Example total sales in array c++ two dimensional array Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12