Skip to content

Commit b460b79

Browse files
committed
added missing expressive attribute
1 parent 49f6a53 commit b460b79

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

samples/EFCoreSample/Models.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public enum OrderStatus
1717

1818
public static class OrderStatusExtensions
1919
{
20+
[Expressive]
2021
public static string GetDescription(this OrderStatus value) => value switch
2122
{
2223
OrderStatus.Pending => "Awaiting processing",
@@ -53,7 +54,7 @@ public class Order
5354
/// Null-conditional navigation — UseExpressives() strips the null check
5455
/// automatically so EF Core can translate it to a JOIN.
5556
[Expressive]
56-
public string? CustomerEmail => Customer?.Email;
57+
public string? CustomerEmail => Total >= 0 ? Customer?.Email : "";
5758

5859
/// Enum method expansion — each enum value is evaluated at compile time,
5960
/// producing a CASE WHEN chain that translates directly to SQL.

0 commit comments

Comments
 (0)