mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-04-19 13:13:54 +00:00
Initial commit
This commit is contained in:
parent
49387f9c3f
commit
21a652df69
6 changed files with 222 additions and 58 deletions
|
|
@ -1,42 +1,59 @@
|
|||
using Packt.Shared;
|
||||
|
||||
/*
|
||||
|
||||
Northwind db = new();
|
||||
WriteLine($"Provider: {db.Database.ProviderName}");
|
||||
*/
|
||||
|
||||
|
||||
// QueryingCategories();
|
||||
|
||||
//FilteredIncludes();
|
||||
// FilteredIncludes();
|
||||
|
||||
//QueryingProducts();
|
||||
// QueryingProducts();
|
||||
|
||||
//QueryingWithLike();
|
||||
|
||||
//GetRandomProduct();
|
||||
|
||||
/*
|
||||
var resultAdd = AddProduct(categoryId: 6,
|
||||
productName: "Bob's Burgers", price: 500M);
|
||||
|
||||
if (resultAdd.affected == 1)
|
||||
{
|
||||
WriteLine("Add product successful.");
|
||||
WriteLine($"Add product successful with ID: {resultAdd.productId}.");
|
||||
}
|
||||
|
||||
ListProducts(productIdToHighlight: resultAdd.productId);
|
||||
ListProducts(productIdsToHighlight: new[] { resultAdd.productId });
|
||||
*/
|
||||
|
||||
/*
|
||||
var resultUpdate = IncreaseProductPrice(
|
||||
productNameStartsWith: "Bob", amount: 20M);
|
||||
|
||||
if (resultUpdate.affected == 1)
|
||||
{
|
||||
WriteLine($"Increase price success for ID: {resultUpdate.productId}.");
|
||||
}
|
||||
|
||||
ListProducts(productIdsToHighlight: new[] { resultUpdate.productId });
|
||||
*/
|
||||
|
||||
/*
|
||||
var resultUpdateBetter = IncreaseProductPricesBetter(
|
||||
productNameStartsWith: "Bob", amount: 20M);
|
||||
|
||||
if (resultUpdateBetter.affected > 0)
|
||||
{
|
||||
WriteLine("Increase product price successful.");
|
||||
}
|
||||
|
||||
ListProducts(productIdToHighlight: resultUpdate.productId);
|
||||
ListProducts(productIdsToHighlight: resultUpdateBetter.productIds);
|
||||
*/
|
||||
|
||||
/*
|
||||
WriteLine("About to delete all products whose name starts with Bob.");
|
||||
Write("Press Enter to continue: ");
|
||||
Write("Press Enter to continue or any other key to exit: ");
|
||||
if (ReadKey(intercept: true).Key == ConsoleKey.Enter)
|
||||
{
|
||||
int deleted = DeleteProducts(productNameStartsWith: "Bob");
|
||||
|
|
@ -45,4 +62,19 @@ if (ReadKey(intercept: true).Key == ConsoleKey.Enter)
|
|||
else
|
||||
{
|
||||
WriteLine("Delete was canceled.");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
WriteLine("About to delete all products whose name starts with Bob.");
|
||||
Write("Press Enter to continue or any other key to exit: ");
|
||||
if (ReadKey(intercept: true).Key == ConsoleKey.Enter)
|
||||
{
|
||||
int deleted = DeleteProductsBetter(productNameStartsWith: "Bob");
|
||||
WriteLine($"{deleted} product(s) were deleted.");
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteLine("Delete was canceled.");
|
||||
}
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue