// Let's ingnore the company for now // Mocking more data as I go... public IEnumerable<Equipment> GetEquipmentByCompany(string equipmentType, Company company) { List<Equipment> equipmentList = new List<Equipment>(); Equipment eq = new Equipment() { Name = "Chiller A", Type = new EntityLink() { Id = "Chiller" }, Id = "1", PointRoles = new Page<PointRole>() }; List<PointRole> l = new List<PointRole>(); l.Add(new PointRole(){ Type = new EntityLink() { Id = "Actual_kWPerTon"}, Point = new EntityLink() { Id = "1" }, }); eq.PointRoles.Items = l; equipmentList.Add(eq); eq = new Equipment() { Name = "Chiller B", Type = new EntityLink() { Id = "Chiller" }, Id = "2", PointRoles = new Page<PointRole>() }; l = new List<PointRole>(); l.Add(new PointRole() { Type = new EntityLink() { Id = "Actual_kWPerTon" }, Point = new EntityLink() { Id = "1" }, }); eq.PointRoles.Items = l; equipmentList.Add(eq); eq = new Equipment() { Name = "Eletric Meter Main office", Type = new EntityLink() { Id = "EletricMeter" }, Id = "3", PointRoles = new Page<PointRole>() }; l = new List<PointRole>(); l.Add(new PointRole() { Type = new EntityLink() { Id = "IntervalDemand" }, Point = new EntityLink() { Id = "1" }, }); eq.PointRoles.Items = l; equipmentList.Add(eq); return equipmentList.Where(e => e.Type.Id == equipmentType); }
private static string FormatEquipmentName(Equipment eq) { if (eq == null || eq.Name == null) { return string.Empty; } return eq.Name.Truncate(30); }