how to update the multiple rows at a time in aspnetboilerplate?

asp.net-core aspnetboilerplate entity-framework-core sql

Question

I want to execute the SQL clause like:

UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;

Because I want to update multiple rows in database. But I don't know how to implement this.

1
0
6/5/2018 7:25:56 AM

Accepted Answer

I have found the solution. Using the extension method GetDbContext of Repository to get the DbContext, then using the DbContext.Database.ExecuteSqlCommandAsync to execute raw SQL.

0
6/5/2018 8:19:02 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow