❔ How optimize this code without breaking it and taking DRY into account?
Hello. I have some issue. This code runs fine but some places repeats to combat null ref exception. This class issues invoice and it's payed by legal person or individual so that's why payedIndividual or payedLegalPerson variable is null and I do WET. How to optimize code with DRY but without breaking it? https://github.com/Nemes1sX/InvoiceApp/blob/master/InvoiceApp/Services/InvoiceService.cs code link, because it's too much post the whole code snippet here