mardi 30 décembre 2014

Best way to compare two objects. Quiz

Im making a new years eve quiz for some friends. The quiz itself is done and working I just thought it would be cool to autocorrect the answers once they are posted.


The question is what's the best way to compare the posted object with an object that has all the right answers, reflection?. There has to be a slick way to do it and avoid having a lot of if's.



public class QuizModel
{
public string Name { get; set; }
public string Quiz1 { get; set; }
public string Quiz2 { get; set; }
public string Quiz3 { get; set; }
etc..
}


You dont have to write me any code. I just want some directions on what the best ( and most important the coolest) way to do it :)






Aucun commentaire:

Enregistrer un commentaire