Skip to content

Commit

Permalink
PT-14189: MySql error in your SQL syntax when open contract price
Browse files Browse the repository at this point in the history
fix: error in your SQL syntax when either open contract price or call GetMergedPrices on MySql
  • Loading branch information
OlegoO committed Nov 1, 2023
1 parent 2980f1e commit 4cd46f8
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ public Task DeletePricelistAssignmentsAsync(IEnumerable<string> ids)
public IQueryable<MergedPriceEntity> GetMergedPrices(string basePriceListId, string priorityPriceListId)
{
var command = GetSearchMergedPricesCommand(basePriceListId, priorityPriceListId);

if (DbContext.Database.ProviderName == "Pomelo.EntityFrameworkCore.MySql")
{
command.Text = command.Text.Replace("\"", "");
}

var query = DbContext.Set<MergedPriceEntity>().FromSqlRaw(command.Text, command.Parameters.ToArray());
return query;
}
Expand Down

0 comments on commit 4cd46f8

Please sign in to comment.