I have a DTO returned by my DAL. For example
public class CustomerDTO
{
public int CustId {get; set; }
public int CustType {get; set; }
.
.
.
public string GetCustomerTypes{
get { if (CustType== 1)
return "Special Customer";
else if(CustType==
}
Now I have multiple properties in my class which are not linked with any table & are just codes representing some attributes like for CustId I can have (1='Special Customer', 2='Defaulter'or 3='New Customer'). Now I need to display their attributes on the DTO.
I can embed my business logic either into SQL statements or my DTO class as I have done above. However, for various columns I end up with a lot of conditional logic. Also, incase I make another DTO, this conditional logic is repeated again.
How can I encapsulate this logic in my class design & avoid repetition?