using InnovEnergy.App.Backend.Model; using InnovEnergy.App.Backend.Utils; using SQLite; namespace InnovEnergy.App.Backend.Database; public partial class Db { private TableQuery Installations => _Db.Table(); public Int32 NbInstallations => Installations.Count(); public Installation? GetInstallationById(Int64 id) => Installations .FirstOrDefault(u => u.Id == id); public Int64 CreateInstallation(Installation installation) { return Create(installation); } public Boolean UpdateInstallation(Installation installation) { return Update(installation); } public Boolean DeleteInstallation(Installation installation) { User2Installation.Delete(i => i.InstallationId == installation.Id); return Delete(installation); } }