mercredi 1 avril 2015

missing return statement in factory pattern c#

i have the following code for my code but it always says the return statement is missing but i have put them in a switch list? please help!?


public IMap Map(string oldtheme) { switch (oldtheme) { case "archer": return new Archer(); case "craftyblue": return new CraftyBlue(); case "minimal": return new Minimal(); case "mintalicious": return new Mintalicious(); case "misfit": return new Misfit(); case "peach": return new Peach(); case "queen": return new Queen(); case "sketch": return new Sketch(); case "takeaway": return new TakeAwayLemonFresh(); case "lemonfresh": return new TakeAwayLemonFresh(); case "vanilla": return new Vanilla(); case "velvet": return new Velvet(); case "victoriana": return new Victoriana(); case "writer": return new Writer();

}



} // this is where the error is
}

Aucun commentaire:

Enregistrer un commentaire