Skip to content

Instantly share code, notes, and snippets.

@DannyRusnok
Last active December 1, 2019 18:30
Show Gist options
  • Save DannyRusnok/20a8b5ed6e961354f5bb7f9b5ef4e997 to your computer and use it in GitHub Desktop.
Save DannyRusnok/20a8b5ed6e961354f5bb7f9b5ef4e997 to your computer and use it in GitHub Desktop.
public class OrdersFacade{
private IExternalCustomerApiService customerApiService;
private IOrderRepository orderRepository;
...
public OrdersFacade(
IExternalCustomerApiService customerApiService,
IOrderRepository orderRepository,
...
)
{
this.customerApiService = customerApiService;
this.orderRepository = orderRepository;
...
}
public bool CreateOrder(){
...
var customerInfoInJson = customerApiService.GetCustomerInfo(customerId);
var customerInfo = JSonConvert.Serialize(customerInfoInJson);
order.CustomerName = customerInfo.Name;
orderRepository.Save(order);
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment