We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49f6a53 commit b460b79Copy full SHA for b460b79
1 file changed
samples/EFCoreSample/Models.cs
@@ -17,6 +17,7 @@ public enum OrderStatus
17
18
public static class OrderStatusExtensions
19
{
20
+ [Expressive]
21
public static string GetDescription(this OrderStatus value) => value switch
22
23
OrderStatus.Pending => "Awaiting processing",
@@ -53,7 +54,7 @@ public class Order
53
54
/// Null-conditional navigation — UseExpressives() strips the null check
55
/// automatically so EF Core can translate it to a JOIN.
56
[Expressive]
- public string? CustomerEmail => Customer?.Email;
57
+ public string? CustomerEmail => Total >= 0 ? Customer?.Email : "";
58
59
/// Enum method expansion — each enum value is evaluated at compile time,
60
/// producing a CASE WHEN chain that translates directly to SQL.
0 commit comments