Add note about JOINs in SQL queries.
This commit is contained in:
parent
001e78736c
commit
1c48a8c9c9
@ -65,6 +65,9 @@ async Task RawSQLStatement()
|
|||||||
Console.WriteLine($"SQL Raw Team: {t.Name}");
|
Console.WriteLine($"SQL Raw Team: {t.Name}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note, that you cannot use JOINs in these SQL queries.
|
||||||
|
// Instead, the Include() function is used to add related data.
|
||||||
|
|
||||||
// FromSqlInterpolated is the revised form of FromSql, and a better choice.
|
// FromSqlInterpolated is the revised form of FromSql, and a better choice.
|
||||||
teams = context.Teams.FromSqlInterpolated($"SELECT * FROM Teams WHERE name = {teamName}");
|
teams = context.Teams.FromSqlInterpolated($"SELECT * FROM Teams WHERE name = {teamName}");
|
||||||
foreach (var t in teams)
|
foreach (var t in teams)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user