EF Core での文字列補間式による生SQLクエリ発行

● EF Coreでの文字列補間式

var category = "C#";

var posts = context.Posts
  .FromSql($"select * from Posts where Category = {category} and IsPrivate = 0")
  .ToList();

引用 : https://qiita.com/Nossa/items/94e5d15a9f05b3bc1b02

No.1985
04/13 14:51

edit