public IEnumerable <GetEquipmentResultResumed> GetEquipments() { var data = _context.Equipments .Where(EquipmentQueries.GetAll()) .Include(p => p.DeviceModel.Manufacturer) .Include(p => p.User) .OrderBy(x => x.ApiLevelDesc) .ToList(); if (data == null) { return(null); } return(data.Select(reg => new GetEquipmentResultResumed { Id = reg.Id.ToString(), PhoneNumber = reg.PhoneNumber, ApiLevel = reg.ApiLevel, ApiLevelDesc = reg.ApiLevelDesc, SerialNumber = reg.SerialNumber, SystemName = reg.SystemName, SystemVersion = reg.SystemVersion, DeviceModel = reg.DeviceModel.Manufacturer.Description + " " + reg.DeviceModel.Description, User = reg.User.Name.ToString() })); }
public IEnumerable <Equipment> GetEquipmentsEnt() { var data = _context.Equipments .Where(EquipmentQueries.GetAll()) .Include(p => p.DeviceModel.Manufacturer) .Include(p => p.User) .OrderBy(x => x.ApiLevelDesc) .ToList(); if (data == null) { return(null); } return(data); }