-
-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved Versioning sample to file-scoped namespaces
- Loading branch information
1 parent
0b870e5
commit b6f1565
Showing
11 changed files
with
748 additions
and
755 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,40 @@ | ||
using System; | ||
|
||
namespace ECommerce.V1 | ||
namespace ECommerce.V1; | ||
|
||
public record ProductItem( | ||
Guid ProductId, | ||
int Quantity | ||
); | ||
|
||
public record PricedProductItem( | ||
ProductItem ProductItem, | ||
decimal UnitPrice | ||
); | ||
|
||
public record ShoppingCartInitialized( | ||
Guid ShoppingCartId, | ||
Guid ClientId | ||
); | ||
|
||
public record ProductItemAddedToShoppingCart( | ||
Guid ShoppingCartId, | ||
PricedProductItem ProductItem | ||
); | ||
|
||
public record ProductItemRemovedFromShoppingCart( | ||
Guid ShoppingCartId, | ||
PricedProductItem ProductItem | ||
); | ||
|
||
public record ShoppingCartConfirmed( | ||
Guid ShoppingCartId, | ||
DateTime ConfirmedAt | ||
); | ||
|
||
public enum ShoppingCartStatus | ||
{ | ||
public record ProductItem( | ||
Guid ProductId, | ||
int Quantity | ||
); | ||
|
||
public record PricedProductItem( | ||
ProductItem ProductItem, | ||
decimal UnitPrice | ||
); | ||
|
||
public record ShoppingCartInitialized( | ||
Guid ShoppingCartId, | ||
Guid ClientId | ||
); | ||
|
||
public record ProductItemAddedToShoppingCart( | ||
Guid ShoppingCartId, | ||
PricedProductItem ProductItem | ||
); | ||
|
||
public record ProductItemRemovedFromShoppingCart( | ||
Guid ShoppingCartId, | ||
PricedProductItem ProductItem | ||
); | ||
|
||
public record ShoppingCartConfirmed( | ||
Guid ShoppingCartId, | ||
DateTime ConfirmedAt | ||
); | ||
|
||
public enum ShoppingCartStatus | ||
{ | ||
Pending = 1, | ||
Confirmed = 2, | ||
Cancelled = 3 | ||
} | ||
Pending = 1, | ||
Confirmed = 2, | ||
Cancelled = 3 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 8 additions & 9 deletions
17
Sample/EventsVersioning/EventsVersioning.Tests/Serializers/SystemTextJsonSerializer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
using System.Text.Json; | ||
|
||
namespace EventsVersioning.Tests.Serializers | ||
namespace EventsVersioning.Tests.Serializers; | ||
|
||
public static class SystemTextJsonSerializer | ||
{ | ||
public static class SystemTextJsonSerializer | ||
{ | ||
public static string Serialize(this object @event) => | ||
JsonSerializer.Serialize(@event); | ||
public static string Serialize(this object @event) => | ||
JsonSerializer.Serialize(@event); | ||
|
||
|
||
public static T? Deserialize<T>(this string @event) => | ||
JsonSerializer.Deserialize<T>(@event); | ||
} | ||
} | ||
public static T? Deserialize<T>(this string @event) => | ||
JsonSerializer.Deserialize<T>(@event); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.