Skip to content

Instantly share code, notes, and snippets.

View pereiren's full-sized avatar

David Pereira pereiren

View GitHub Profile
├── src
│ ├── Api # API layer
| | ├── UseCases # API business rules in use cases
| | | ├── GetTodos # Use Case to get all the todo tasks
| | | | ├── TodoController.cs # Todo Controller for the Get All
| | | | ├── GetTodosPresenter.cs # Presenter
│ ├── Application # Application layer
| | ├── Boundaries # Input and output ports helping us to cross boundaries
| | ├── Services # Application services to handle application business logic
| | ├── UseCases # Use cases interactors
@pereiren
pereiren / CheckOutService.cs
Created February 23, 2020 12:13
Domain Service
public class CheckoutService : IDomainService
{
IRepository<Purchase> purchaseRepository;
public CheckoutService(IRepository<Purchase> purchaseRepository)
{
this.purchaseRepository = purchaseRepository;
}
public class CartService : ICartService
{
//...
CheckoutService checkoutDomainService;
public CartService(... CheckoutService checkoutDomainService ...)
{
//...
this.checkoutDomainService = checkoutDomainService;
public class CartController : ApiController
{
private readonly ICartService _cartService;
public CartController(ICartService cartService)
{
_cartService = cartService;
}
[HttpPost]
public class CartController : ApiController
{
private readonly ICartService _cartService;
public CartController(ICartService cartService)
{
_cartService = cartService;
}
[HttpPost]