This commit is contained in:
2020-01-27 18:05:14 +00:00
parent 629cc300e4
commit eaefc5649b
5 changed files with 43 additions and 46 deletions

View File

@@ -446,12 +446,12 @@ namespace AyaNova.Biz
ProcessKeywords(searchIndexObjectParameters, false);//localeId, objectID, objectType, false, name, text);
}
public static void ProcessDeletedObjectKeywords(long objectID, AyaType objectType)
public static async Task ProcessDeletedObjectKeywordsAsync(long objectID, AyaType objectType)
{
//Be careful in future, if you put ToString at the end of each object in the string interpolation
//npgsql driver will assume it's a string and put quotes around it triggering an error that a string can't be compared to an int
AyContext ct = ServiceProviderProvider.DBContext;
ct.Database.ExecuteSqlInterpolated($"delete from asearchkey where objectid={objectID} and objecttype={(int)objectType}");
await ct.Database.ExecuteSqlInterpolatedAsync($"delete from asearchkey where objectid={objectID} and objecttype={(int)objectType}");
}
@@ -477,7 +477,7 @@ namespace AyaNova.Biz
//IF NOT NEW, DELETE ALL EXISTING ENTRIES FOR OBJECT TYPE AND ID
if (!newRecord)
{
ProcessDeletedObjectKeywords(p.ObjectId, p.ObjectType);
ProcessDeletedObjectKeywordsAsync(p.ObjectId, p.ObjectType);
}
//BREAK OBJECT TEXT STRINGS INTO KEYWORD LIST