Fix performance issues, esp regarding saving tags

This commit is contained in:
Robert McRackan 2019-11-18 14:37:17 -05:00
parent 6734dec55c
commit f3128b562d
12 changed files with 142 additions and 176 deletions

View file

@ -23,14 +23,12 @@ namespace ApplicationServices
return (totalCount, newCount);
}
public static int IndexChangedTags(Book book)
public static int UpdateTags(this LibationContext context, Book book, string newTags)
{
// update disconnected entity
using var context = LibationContext.Create();
context.Update(book);
book.UserDefinedItem.Tags = newTags;
var qtyChanges = context.SaveChanges();
// this part is tags-specific
if (qtyChanges > 0)
SearchEngineCommands.UpdateBookTags(book);