mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Storage - Use nullable reference types
Core - Fix build warnings
This commit is contained in:
1 parent
f0e9581fe1
commit
248d4c8e18
65 files changed
+318
-159
No files matched your search
@@ -25,7 +25,7 @@ internal class DeviceRepository : IDeviceRepository
|
||||
_repository.Delete<DeviceEntity>(deviceEntity.Id);
|
||||
}
|
||||
|
||||
public DeviceEntity Get(string id)
|
||||
public DeviceEntity? Get(string id)
|
||||
{
|
||||
return _repository.FirstOrDefault<DeviceEntity>(s => s.Id == id);
|
||||
}
|
||||
|
||||
@@ -27,12 +27,12 @@ internal class EntryRepository : IEntryRepository
|
||||
_repository.Delete<EntryEntity>(entryEntity.Id);
|
||||
}
|
||||
|
||||
public EntryEntity Get(Guid id)
|
||||
public EntryEntity? Get(Guid id)
|
||||
{
|
||||
return _repository.FirstOrDefault<EntryEntity>(s => s.Id == id);
|
||||
}
|
||||
|
||||
public EntryEntity GetByEntryId(long entryId)
|
||||
public EntryEntity? GetByEntryId(long entryId)
|
||||
{
|
||||
return _repository.FirstOrDefault<EntryEntity>(s => s.EntryId == entryId);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ public interface IDeviceRepository : IRepository
|
||||
{
|
||||
void Add(DeviceEntity deviceEntity);
|
||||
void Remove(DeviceEntity deviceEntity);
|
||||
DeviceEntity Get(string id);
|
||||
DeviceEntity? Get(string id);
|
||||
List<DeviceEntity> GetAll();
|
||||
void Save(DeviceEntity deviceEntity);
|
||||
void Save(IEnumerable<DeviceEntity> deviceEntities);
|
||||
|
||||
@@ -8,8 +8,8 @@ public interface IEntryRepository : IRepository
|
||||
{
|
||||
void Add(EntryEntity entryEntity);
|
||||
void Remove(EntryEntity entryEntity);
|
||||
EntryEntity Get(Guid id);
|
||||
EntryEntity GetByEntryId(long entryId);
|
||||
EntryEntity? Get(Guid id);
|
||||
EntryEntity? GetByEntryId(long entryId);
|
||||
List<EntryEntity> GetAll();
|
||||
void Save(EntryEntity entryEntity);
|
||||
void Save(IEnumerable<EntryEntity> entryEntities);
|
||||
|
||||
@@ -6,12 +6,12 @@ namespace Artemis.Storage.Repositories.Interfaces;
|
||||
public interface IPluginRepository : IRepository
|
||||
{
|
||||
void AddPlugin(PluginEntity pluginEntity);
|
||||
PluginEntity GetPluginByGuid(Guid pluginGuid);
|
||||
PluginEntity? GetPluginByGuid(Guid pluginGuid);
|
||||
void SavePlugin(PluginEntity pluginEntity);
|
||||
|
||||
void AddSetting(PluginSettingEntity pluginSettingEntity);
|
||||
PluginSettingEntity GetSettingByGuid(Guid pluginGuid);
|
||||
PluginSettingEntity GetSettingByNameAndGuid(string name, Guid pluginGuid);
|
||||
PluginSettingEntity? GetSettingByGuid(Guid pluginGuid);
|
||||
PluginSettingEntity? GetSettingByNameAndGuid(string name, Guid pluginGuid);
|
||||
void SaveSetting(PluginSettingEntity pluginSettingEntity);
|
||||
void RemoveSettings(Guid pluginGuid);
|
||||
}
|
||||
@@ -10,8 +10,8 @@ public interface IProfileCategoryRepository : IRepository
|
||||
void Add(ProfileCategoryEntity profileCategoryEntity);
|
||||
void Remove(ProfileCategoryEntity profileCategoryEntity);
|
||||
List<ProfileCategoryEntity> GetAll();
|
||||
ProfileCategoryEntity Get(Guid id);
|
||||
Stream GetProfileIconStream(Guid id);
|
||||
ProfileCategoryEntity? Get(Guid id);
|
||||
Stream? GetProfileIconStream(Guid id);
|
||||
void SaveProfileIconStream(ProfileConfigurationEntity profileConfigurationEntity, Stream stream);
|
||||
ProfileCategoryEntity IsUnique(string name, Guid? id);
|
||||
void Save(ProfileCategoryEntity profileCategoryEntity);
|
||||
|
||||
@@ -9,6 +9,6 @@ public interface IProfileRepository : IRepository
|
||||
void Add(ProfileEntity profileEntity);
|
||||
void Remove(ProfileEntity profileEntity);
|
||||
List<ProfileEntity> GetAll();
|
||||
ProfileEntity Get(Guid id);
|
||||
ProfileEntity? Get(Guid id);
|
||||
void Save(ProfileEntity profileEntity);
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
namespace Artemis.Storage.Repositories.Interfaces;
|
||||
|
||||
public interface IRepository
|
||||
{
|
||||
}
|
||||
public interface IRepository;
|
||||
@@ -21,7 +21,7 @@ internal class PluginRepository : IPluginRepository
|
||||
_repository.Insert(pluginEntity);
|
||||
}
|
||||
|
||||
public PluginEntity GetPluginByGuid(Guid pluginGuid)
|
||||
public PluginEntity? GetPluginByGuid(Guid pluginGuid)
|
||||
{
|
||||
return _repository.FirstOrDefault<PluginEntity>(p => p.Id == pluginGuid);
|
||||
}
|
||||
@@ -37,12 +37,12 @@ internal class PluginRepository : IPluginRepository
|
||||
_repository.Insert(pluginSettingEntity);
|
||||
}
|
||||
|
||||
public PluginSettingEntity GetSettingByGuid(Guid pluginGuid)
|
||||
public PluginSettingEntity? GetSettingByGuid(Guid pluginGuid)
|
||||
{
|
||||
return _repository.FirstOrDefault<PluginSettingEntity>(p => p.PluginGuid == pluginGuid);
|
||||
}
|
||||
|
||||
public PluginSettingEntity GetSettingByNameAndGuid(string name, Guid pluginGuid)
|
||||
public PluginSettingEntity? GetSettingByNameAndGuid(string name, Guid pluginGuid)
|
||||
{
|
||||
return _repository.FirstOrDefault<PluginSettingEntity>(p => p.Name == name && p.PluginGuid == pluginGuid);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ internal class ProfileCategoryRepository : IProfileCategoryRepository
|
||||
return _repository.Query<ProfileCategoryEntity>().ToList();
|
||||
}
|
||||
|
||||
public ProfileCategoryEntity Get(Guid id)
|
||||
public ProfileCategoryEntity? Get(Guid id)
|
||||
{
|
||||
return _repository.FirstOrDefault<ProfileCategoryEntity>(p => p.Id == id);
|
||||
}
|
||||
@@ -52,7 +52,7 @@ internal class ProfileCategoryRepository : IProfileCategoryRepository
|
||||
_repository.Upsert(profileCategoryEntity);
|
||||
}
|
||||
|
||||
public Stream GetProfileIconStream(Guid id)
|
||||
public Stream? GetProfileIconStream(Guid id)
|
||||
{
|
||||
if (!_profileIcons.Exists(id))
|
||||
return null;
|
||||
|
||||
@@ -31,7 +31,7 @@ internal class ProfileRepository : IProfileRepository
|
||||
return _repository.Query<ProfileEntity>().ToList();
|
||||
}
|
||||
|
||||
public ProfileEntity Get(Guid id)
|
||||
public ProfileEntity? Get(Guid id)
|
||||
{
|
||||
return _repository.FirstOrDefault<ProfileEntity>(p => p.Id == id);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user