Beispiel #1
0
 static DanceViewModel()
 {
     foreach (var dance in Dances.All)
     {
         AllDances[dance] = new DanceViewModel(dance);
     }
 }
Beispiel #2
0
 public static DanceViewModel GetOrAdd(Dance dance)
 {
     if (!AllDances.ContainsKey(dance))
     {
         AllDances[dance] = new DanceViewModel(dance);
     }
     return(AllDances[dance]);
 }
Beispiel #3
0
 public static IEnumerable <DanceViewModel> ToViewModel(this IEnumerable <Dance> dances)
 {
     return(dances.Select <Dance, DanceViewModel>((d) => DanceViewModel.GetOrAdd(d)));
 }