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(); } }
public IEnumerable <ProductOption> GetOptions(Guid productId) { ProductOptionsQuery query = new ProductOptionsQuery(); return(query.GetAll(productId)); }