ISqlBuilderBase.SqlType Property
.NET Standard 2.x | Current Version (1.0.1)
Gets the SQL statement type of the current object.
Namespace: SnapObjects.Data
Assembly: SnapObjects.Data.dll
Syntax
SqlStatementType SqlType { get; }
Returns
SnapObjects.Data.SqlStatementType
Returns an enumeration value of the SqlStatementType
.
Examples
The following code example demonstrates how to use the SqlType property.
using SnapObjects.Data;
using System;
namespace Appeon.ApiDoc.ISqlBuilderBaseExamples
{
public class SqlTypeExample
{
private SchoolContext _context;
public SqlTypeExample(SchoolContext dataContext)
{
// Sets Data Context.
_context = dataContext;
}
public void Example()
{
// Creates a SqlQueryBuilder object.
var sqlQueryBuilder = new SqlQueryBuilder();
sqlQueryBuilder.Select("name")
.From("Department")
.WhereValue("DepartmentId", 1);
// Gets the SQL type.
Console.WriteLine("The SQL Type of the SqlQueryBuilder Object: \n{0}",
sqlQueryBuilder.SqlType);
// Creates a SqlDeleteBuilder object.
var sqlDeleteBuilder = new SqlDeleteBuilder("DeptQuery");
sqlDeleteBuilder.Delete("Department")
.WhereValue("DepartmentId", 1);
// Gets the SQL type.
Console.WriteLine("The SQL Type of the SqlDeleteBuilder Object: \n{0}",
sqlDeleteBuilder.SqlType);
/*This code produces the following output:
The SQL Type of the SqlQueryBuilder Object:
Select
The SQL Type of the SqlDeleteBuilder Object:
Delete
*/
}
}
}
Applies to
.NET Standard
2.x