Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

What's the difference between ExecuteSqlInterpolated and ExecuteSql?

$
0
0

The difference between with ExecuteSqlRaw is clear, but ExecuteSqlInterpolated and ExecuteSql looks smilar, also in the docs.

  • Both has the same parameters and output:

    public static int ExecuteSqlInterpolated (this Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade databaseFacade, FormattableString sql);public static int ExecuteSql             (this Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade databaseFacade, FormattableString sql);
  • Both has the same description: "Executes the given SQL against the database and returns the number of rows affected."

  • Both has exact the same remarks:enter image description here

  • None of them is marked obsolete

The only difference in the docs:

ExecuteSqlInterpolated:enter image description here

ExecuteSql:enter image description here

So ExecuteSql is introduced in EF Core 7.

So are these the same and should I use ExecuteSql instead of ExecuteSqlInterpolated for EF Core 7/8 as this one is newer?


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>