diff --git a/src/Lanceur.Core/BusinessLogic/AliasQueryResultMixin.cs b/src/Lanceur.Core/BusinessLogic/AliasQueryResultMixin.cs index beacf87b..7f4627b1 100644 --- a/src/Lanceur.Core/BusinessLogic/AliasQueryResultMixin.cs +++ b/src/Lanceur.Core/BusinessLogic/AliasQueryResultMixin.cs @@ -45,7 +45,7 @@ public static IEnumerable CloneFromSynonyms(this AliasQueryRes if (errors.Any()) throw new AggregateException($"Errors occured while updating synonyms of alias with these synonyms: {alias.Synonyms}", errors); - return results; + return results.ToList(); } #endregion Methods diff --git a/src/Lanceur/Views/KeywordsViewModel.cs b/src/Lanceur/Views/KeywordsViewModel.cs index c2836052..acbdd510 100644 --- a/src/Lanceur/Views/KeywordsViewModel.cs +++ b/src/Lanceur/Views/KeywordsViewModel.cs @@ -253,7 +253,7 @@ private void AfterSaveOrUpdateAlias(QueryResult updated) .Add("TypeOfQueryResult", updated.GetType()) .BeginScope(); // Remove all synonyms ... - var toDel = Aliases.Where(a => a.Id == updated.Id); + var toDel = Aliases.Where(a => a.Id == updated.Id).ToList(); Aliases.Remove(toDel); // ... and recreate them @@ -262,7 +262,9 @@ private void AfterSaveOrUpdateAlias(QueryResult updated) // Sort and display selected alias Aliases.SortCollection(criterion => criterion.Name); - SelectedAlias = updatedAlias; + SelectedAlias = Aliases.Where(a=>a.Id == updated.Id) + .Cast() + .FirstOrDefault() ; } catch(Exception ex) {