using InnovEnergy.App.Backend.DataTypes; using InnovEnergy.App.Backend.DataTypes.Methods; using InnovEnergy.App.Backend.Relations; namespace InnovEnergy.App.Backend.Database; public static partial class Db { public static Boolean Create(Installation installation) { // SQLite wrapper is smart and *modifies* t's Id to the one generated (autoincrement) by the insertion return Connection.Insert(installation) > 0; } public static Boolean Create(Folder folder) { return Connection.Insert(folder) > 0; } public static Boolean Create(User user) { if (GetUserByEmail(user.Email) is not null) // TODO: User unique by username instead of email? return false; user.Password = user.SaltAndHashPassword(user.Password); return Connection.Insert(user) > 0; } public static Boolean Create(Session session) { return Connection.Insert(session) > 0; } }