Storage - Fix new profile creation

UI - Fix a crash when dragging and dropping in the sidebar
This commit is contained in:
Robert committed 2024-03-15 17:13:21 +01:00
1 parent 18d75318d9
commit 7e981a61d3
9 files changed
+27 -34

No files matched your search

@@ -30,6 +30,8 @@ public class ProfileRepository(ILogger logger, Func<ArtemisDbContext> getContext
public void Save(ProfileContainerEntity profileContainerEntity)
{
profileContainerEntity.ProfileConfiguration.Version = profileMigrators.Max(m => m.Version);
using ArtemisDbContext dbContext = getContext();
dbContext.Update(profileContainerEntity);
dbContext.SaveChanges();
@@ -37,6 +39,9 @@ public class ProfileRepository(ILogger logger, Func<ArtemisDbContext> getContext
public void SaveRange(List<ProfileContainerEntity> profileContainerEntities)
{
foreach (ProfileContainerEntity profileContainerEntity in profileContainerEntities)
profileContainerEntity.ProfileConfiguration.Version = profileMigrators.Max(m => m.Version);
using ArtemisDbContext dbContext = getContext();
dbContext.UpdateRange(profileContainerEntities);
dbContext.SaveChanges();