コード例 #1
0
ファイル: DeleteProduct.cs プロジェクト: gando001/refaction
        public void Call()
        {
            ProductOptionsQuery query = new ProductOptionsQuery();

            foreach (ProductOption option in query.GetAll(Product.Id))
            {
                new DeleteProductOption(option).Call();
            }

            using (SqlCommand command = new SqlCommand())
            {
                command.CommandText = "delete from product where id = '@id'";
                command.Parameters.AddWithValue("@id", Product.Id);

                new RunQuery(command).Execute();
            }
        }
コード例 #2
0
        public IEnumerable <ProductOption> GetOptions(Guid productId)
        {
            ProductOptionsQuery query = new ProductOptionsQuery();

            return(query.GetAll(productId));
        }