KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to return an Interface and inside a switch statement I would like to set it. Is this a bad design? private IResultEntity GetEntity(char? someType) { IResultEntity entity = null; switch (someType) { case 'L': //life entity = new LifeEntity(); break; case 'P': //property entity = new PropertyEntity(); break; case 'D': //disability entity = new DisabilityEntity(); break; case 'C': //credit card entity = new CreditCardEntity(); break; } return entity; }
Tags (comma-separated)
Save Edits
Cancel