DataContext.SqlExecutor Property
.NET Standard 2.x
Gets an ISqlExecutor
object created by the current DataContext
.
Namespace: SnapObjects.Data
Assembly: SnapObjects.Data.dll
Syntax
public ISqlExecutor SqlExecutor { get; }
Property Value
An ISqlExecutor
object created by the current DataContext
.
Examples
The following code example demonstrates how to use the SqlExecutor object to execute a SQL statement and output the object type.
using System;
namespace Appeon.ApiDoc.DataContextExamples
{
public class SqlExecutorExample
{
private readonly SchoolContext _context;
public SqlExecutorExample(SchoolContext context)
{
_context = context;
}
public void Example()
{
var sqlExecute = _context.SqlExecutor;
// Executes a SQL statement
sqlExecute.Execute("select * from Course");
// Shows the type of the SqlExecutor object.
Console.WriteLine("Type = {0}", sqlExecute.ToString());
/* This code example produces the following output:
Type = SnapObjects.Data.SqlExecutor
*/
}
}
}
Applies to
.NET Standard
2.x