Fix: EDM -> Cast<>; Retrieve items first

This commit is contained in:
Gary Sharp
2013-05-06 19:09:04 +10:00
parent 9d39eff7ee
commit 54961cdf22
2 changed files with 2 additions and 2 deletions
@@ -26,7 +26,7 @@ namespace Disco.Web.Areas.Config.Models.DeviceBatch
WarrantyExpires = db.WarrantyValidUntil, WarrantyExpires = db.WarrantyValidUntil,
InsuranceSupplier = db.InsuranceSupplier, InsuranceSupplier = db.InsuranceSupplier,
InsuredUntil = db.InsuredUntil InsuredUntil = db.InsuredUntil
}).Cast<ConfigDeviceBatchIndexModelItem>().ToList(); }).ToArray().Cast<ConfigDeviceBatchIndexModelItem>().ToList();
return m; return m;
} }
@@ -25,7 +25,7 @@ namespace Disco.Web.Areas.Config.Models.DeviceProfile
DistributionTypeId = dp.DistributionTypeDb, DistributionTypeId = dp.DistributionTypeDb,
DeviceCount = dp.Devices.Count, DeviceCount = dp.Devices.Count,
DeviceDecommissionedCount = dp.Devices.Count(d => d.DecommissionedDate.HasValue) DeviceDecommissionedCount = dp.Devices.Count(d => d.DecommissionedDate.HasValue)
}).Cast<ConfigDeviceProfileIndexModelItem>().ToList(); }).ToArray().Cast<ConfigDeviceProfileIndexModelItem>().ToList();
if (DiscoApplication.MultiSiteMode) if (DiscoApplication.MultiSiteMode)
{ {