fixes
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
Address = new Address { City = "Castle Douglas", Country = "UK" }
|
Address = new Address { City = "Castle Douglas", Country = "UK" }
|
||||||
};
|
};
|
||||||
if (customer is { Address.City: "Castle Douglas" }) {
|
if (customer is { Address.City: "Castle Douglas" }) {
|
||||||
Console.WriteLine("Dieser Kunde wohnt gleich um die Ecke");
|
Console.WriteLine("This customer lives around the corner");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
{
|
{
|
||||||
1 => 2,
|
1 => 2,
|
||||||
2 => 3,
|
2 => 3,
|
||||||
_ => throw new ArgumentException("Weiter geht's nicht")
|
_ => throw new ArgumentException("Rien ne va plus")
|
||||||
};
|
};
|
||||||
|
|
||||||
// Property Pattern:
|
// Property Pattern:
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
Address = new Address { City = "Castle Douglas", Country = "UK" }
|
Address = new Address { City = "Castle Douglas", Country = "UK" }
|
||||||
};
|
};
|
||||||
if (customer is { Address: { City: "Castle Douglas" } }) {
|
if (customer is { Address: { City: "Castle Douglas" } }) {
|
||||||
Console.WriteLine("Dieser Kunde wohnt gleich um die Ecke");
|
Console.WriteLine("This customer lives around the corner");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum OrderValue {
|
||||||
|
ValuableDueToHighCount,
|
||||||
|
ValuableDueToHighItemPrice,
|
||||||
|
ValuableDueToHighTotal,
|
||||||
|
NotValuable,
|
||||||
|
}
|
||||||
|
|
||||||
// Positional patterns with placeholders - note that
|
// Positional patterns with placeholders - note that
|
||||||
// the element lists must be "complete"!
|
// the element lists must be "complete"!
|
||||||
static OrderValue OrderValueCategory(Order o) =>
|
static OrderValue OrderValueCategory(Order o) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user