0

I am using below migration script to query against postgreSQL with EF core, for column names and table names i need to be enclosed with this symbol " ".

according to above condition i am writing the script like below, is there any way to escape the concatenation with + sign

migrationBuilder.Sql("UPDATE " + "\"" + "LibraryPipePlantTypes" + "\"" + " SET " + "\"" + "MasterSectionName" + "\"" + " = "+ "'" + "Library Pipe Plant Type" + "'" + " WHERE" + "\"" + "MasterSectionName" + "\"" + " = " + "'" + "Library Hydronic Plant Type" + "'");

Many thanks in advance.

Glory Raj
  • 17,397
  • 27
  • 100
  • 203
  • You've tried to write the string out with the escape character and no concats? Like `"UPDATE \"LibraryPipePlantTypes\" SET"`? Other discussion and examples on SO found [here](https://stackoverflow.com/questions/14480724/escape-double-quotes-in-string). – Sean Skelly Apr 21 '20 at 16:17

1 Answers1

0

You could try using

migrationBuilder.Sql('UPDATE "LibraryPipePlantTypes" SET "MasterSectionName" = "Library Pipe Plant Type" WHERE "MasterSectionName" = "Library Hydronic Plant Type"');