コード例 #1
0
        public int AddMovie(Movie movie)
        {
            var    Id     = (int)DBX.ExecScalarQuery($"select max(Id) from Movie") + 1;
            string sqlAdd = $"insert into Movie values ({Id}, '{movie.title}', '{movie.genre}', '{movie.price}', '{movie.releaseDate}') ";

            DBX.ExecNonQuery(sqlAdd);
            return(Id);
        }
コード例 #2
0
        public void DeleteMovie(int id)
        {
            string sqlDelete = $"delete from Movie where Id = {id} ";

            DBX.ExecNonQuery(sqlDelete);
        }