mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Materialize before returning data from GetAll calls, tested this time
This commit is contained in:
parent
1196a95336
commit
f66df43cc2
@ -28,10 +28,10 @@ internal class DeviceRepository(Func<ArtemisDbContext> getContext) : IDeviceRepo
|
||||
return dbContext.Devices.FirstOrDefault(d => d.Id == id);
|
||||
}
|
||||
|
||||
public IEnumerable<DeviceEntity> GetAll()
|
||||
public List<DeviceEntity> GetAll()
|
||||
{
|
||||
using ArtemisDbContext dbContext = getContext();
|
||||
return dbContext.Devices.AsEnumerable();
|
||||
return dbContext.Devices.ToList();
|
||||
}
|
||||
|
||||
public void Save(DeviceEntity deviceEntity)
|
||||
|
||||
@ -34,10 +34,10 @@ internal class EntryRepository(Func<ArtemisDbContext> getContext) : IEntryReposi
|
||||
return dbContext.Entries.FirstOrDefault(s => s.EntryId == entryId);
|
||||
}
|
||||
|
||||
public IEnumerable<EntryEntity> GetAll()
|
||||
public List<EntryEntity> GetAll()
|
||||
{
|
||||
using ArtemisDbContext dbContext = getContext();
|
||||
return dbContext.Entries.AsEnumerable();
|
||||
return dbContext.Entries.ToList();
|
||||
}
|
||||
|
||||
public void Save(EntryEntity entryEntity)
|
||||
|
||||
@ -8,7 +8,7 @@ public interface IDeviceRepository : IRepository
|
||||
void Add(DeviceEntity deviceEntity);
|
||||
void Remove(DeviceEntity deviceEntity);
|
||||
DeviceEntity? Get(string id);
|
||||
IEnumerable<DeviceEntity> GetAll();
|
||||
List<DeviceEntity> GetAll();
|
||||
void Save(DeviceEntity deviceEntity);
|
||||
void SaveRange(IEnumerable<DeviceEntity> deviceEntities);
|
||||
}
|
||||
@ -10,6 +10,6 @@ public interface IEntryRepository : IRepository
|
||||
void Remove(EntryEntity entryEntity);
|
||||
EntryEntity? Get(Guid id);
|
||||
EntryEntity? GetByEntryId(long entryId);
|
||||
IEnumerable<EntryEntity> GetAll();
|
||||
List<EntryEntity> GetAll();
|
||||
void Save(EntryEntity entryEntity);
|
||||
}
|
||||
@ -8,7 +8,7 @@ public interface IProfileCategoryRepository : IRepository
|
||||
{
|
||||
void Add(ProfileCategoryEntity profileCategoryEntity);
|
||||
void Remove(ProfileCategoryEntity profileCategoryEntity);
|
||||
IEnumerable<ProfileCategoryEntity> GetAll();
|
||||
List<ProfileCategoryEntity> GetAll();
|
||||
ProfileCategoryEntity? Get(Guid id);
|
||||
bool IsUnique(string name, Guid? id);
|
||||
void Save(ProfileCategoryEntity profileCategoryEntity);
|
||||
|
||||
@ -25,7 +25,7 @@ internal class ProfileCategoryRepository(Func<ArtemisDbContext> getContext, IPro
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
|
||||
public IEnumerable<ProfileCategoryEntity> GetAll()
|
||||
public List<ProfileCategoryEntity> GetAll()
|
||||
{
|
||||
if (!_migratedProfiles)
|
||||
{
|
||||
@ -34,7 +34,7 @@ internal class ProfileCategoryRepository(Func<ArtemisDbContext> getContext, IPro
|
||||
}
|
||||
|
||||
using ArtemisDbContext dbContext = getContext();
|
||||
return dbContext.ProfileCategories.Include(c => c.ProfileConfigurations).AsEnumerable();
|
||||
return dbContext.ProfileCategories.Include(c => c.ProfileConfigurations).ToList();
|
||||
}
|
||||
|
||||
public ProfileCategoryEntity? Get(Guid id)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user