Fix performance issues, esp regarding saving tags
This commit is contained in:
parent
6734dec55c
commit
f3128b562d
12 changed files with 142 additions and 176 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue