Interface ISqlQuery
- Namespace
- Microsoft.EntityFrameworkCore.Metadata
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Represents a SQL query string.
public interface ISqlQuery : ITableBase, IAnnotatable, IReadOnlyAnnotatable
- Inherited Members
Remarks
See Executing raw SQL commands with EF Core for more information and examples.
Properties
Columns
Gets the columns defined for this query.
IEnumerable<ISqlQueryColumn> Columns { get; }
Property Value
EntityTypeMappings
Gets the entity type mappings.
IEnumerable<ISqlQueryMapping> EntityTypeMappings { get; }
Property Value
Sql
Gets the SQL query string.
string Sql { get; }
Property Value
Methods
FindColumn(IProperty)
Gets the column mapped to the given property. Returns null if no column is mapped to the given property.
ISqlQueryColumn? FindColumn(IProperty property)
Parameters
property
IProperty
Returns
FindColumn(string)
Gets the column with the given name. Returns null if no column with the given name is defined.
ISqlQueryColumn? FindColumn(string name)
Parameters
name
string
Returns
ToDebugString(MetadataDebugStringOptions, int)
Creates a human-readable representation of the given metadata.
Warning: Do not rely on the format of the returned string. It is designed for debugging only and may change arbitrarily between releases.
string ToDebugString(MetadataDebugStringOptions options = 0, int indent = 0)
Parameters
options
MetadataDebugStringOptionsOptions for generating the string.
indent
intThe number of indent spaces to use before each new line.
Returns
- string
A human-readable representation.