public string GetGebruikerNaam(GebruikerBase gebruiker) { switch (gebruiker) { case SysteemGebruiker sg: throw new NotSupportedException(); case Gebruiker g: return(g.Naam); default: throw new NotImplementedException(); } }
/// <summary> /// Refactorslag 1 /// </summary> /// <param name="gebruiker"></param> /// <returns></returns> public string GetGebruikerNaam2(GebruikerBase gebruiker) { return(gebruiker.GetName()); }