Skip to content

Instantly share code, notes, and snippets.

@ThiagoBarradas
Last active January 9, 2021 23:53
Show Gist options
  • Save ThiagoBarradas/d3d589a095aa31ab46338c8c9578a52c to your computer and use it in GitHub Desktop.
Save ThiagoBarradas/d3d589a095aa31ab46338c8c9578a52c to your computer and use it in GitHub Desktop.
SOLID [S] - Wrong Method
public class PaymentService
{
public Payment ProcessPayment(Payment payment)
{
if (payment.Type == "credit_card")
{
// proccess payment with credit card
}
else if (payment.Type == "debit_card")
{
// proccess payment with debit card
}
else if (payment.Type == "bank_invoice")
{
// proccess payment with bank invoice
}
// some code
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment