public Link GetById(long id) { using (var connection = connectionFactory.CreateConnection()) { return(helperService.GetScalarMapped <Link>(connection, "SELECT rowid, * " + "FROM links " + "WHERE rowid=$id", new Parameter("id", id))); } }
public User Get(string username, string password) { using (var connection = connectionFactory.CreateConnection()) { (connection as SqliteConnection).CreateFunction("sha256", (string text, string salt) => Sha256(text + salt)); return(helperService.GetScalarMapped <User>(connection, "SELECT rowid, *" + "FROM users " + "WHERE Username=$username AND Password=sha256($hash, Salt)", new Parameter("username", username), new Parameter("hash", Sha256(password)))); } }