In code review I have found interesting construction:
public ActionResult SeatMap(string name)
{
var equimpment = this.CustomResourcesCache.GetAllEquipment(name);
if (string.IsNullOrEmpty(name))
{
List<dynamic> all = new List<dynamic>();
foreach (var item in equimpment)
{
all.Add(item.Tag[0]);
}
return CachedResult(new { SeatMaps = all } );
}
return CachedResult(new { SeatMaps = equimpment.Where(o => o.Key == name).Count()>0?equimpment.Where(o => o.Key == name).First().Tag:new List<dynamic>() });
}
I am just wondering why they used List <<[dynamic]>> instead of List<<[T]>> and is there any other solution instead of this one.
Thanks