This file contains hidden or 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
Policy | |
.Handle<Exception>() | |
.RetryForever(exception => | |
{ | |
YourFunction(); | |
}); |
This file contains hidden or 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
Policy | |
.Handle<Exception>() | |
.Retry(3, (exception, retryCount) => | |
{ | |
var result = YourFunction(); | |
}); |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Security.Cryptography.X509Certificates; | |
using Newtonsoft.Json; | |
using Sales.Common.Dto; | |
using Sales.Common.Events; | |
using MicroServices.Common; | |
using MicroServices.Common.Exceptions; | |
using MicroServices.Common.Repository; |
This file contains hidden or 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
using System; | |
using System.Web.Http; | |
using MicroServices.Common.Exceptions; | |
namespace Sales.ReadModels.Service.Controllers | |
{ | |
public class OrdersController : ApiController | |
{ | |
[HttpGet] | |
public IHttpActionResult Get(Guid id) |
This file contains hidden or 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
using System; | |
using System.Linq; | |
using Sales.Common.Events; | |
using MicroServices.Common; | |
namespace Sales.Service.MicroServices.Order.Domain | |
{ | |
public class Order : Aggregate | |
{ | |
private Order() |
This file contains hidden or 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
using System; | |
using Sales.Service.MicroServices.Order.Commands; | |
using MicroServices.Common.Repository; | |
using Sales.Service.MicroServices.Product.View; | |
using Products.ReadModels.Client; | |
namespace Sales.Service.MicroServices.Order.Handlers | |
{ | |
public class OrderCommandHandlers | |
{ |
This file contains hidden or 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
using System; | |
using MicroServices.Common; | |
namespace Sales.Service.MicroServices.Order.Commands | |
{ | |
public class StartNewOrder : ICommand | |
{ | |
public StartNewOrder(Guid id, Guid productId, int quantity) | |
{ | |
Id = id; |
This file contains hidden or 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
using System; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Http; | |
using Sales.Service.DataTransferObjects.Commands; | |
using Sales.Service.MicroServices.Order.Commands; | |
namespace Sales.Service.Controllers | |
{ | |
public class OrdersController : ApiController |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using Products.Common.Dto; | |
using MicroServices.Common; | |
using Products.Common.Events; | |
using MicroServices.Common.Exceptions; | |
using MicroServices.Common.Repository; | |
namespace Products.ReadModels.Service.Views | |
{ |
This file contains hidden or 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
using System; | |
using System.Web.Http; | |
using MicroServices.Common.Exceptions; | |
namespace Products.ReadModels.Service.Controllers | |
{ | |
public class ProductsController : ApiController | |
{ | |
[HttpGet] | |
public IHttpActionResult Get(Guid id) |