public async Task <List <MachineViewModel> > GetListMachineType(string factory, string building) { var machines = await _repoMachineInfomation.GetAll() .Where(x => x.factory_id.Trim() == factory.Trim() && building == "ALL"? 1 == 1 : x.building_id.Trim() == building.Trim()) .ToListAsync(); var machineType = await _repoMachineType.GetAll().ToListAsync(); var data = (from a in machines join b in machineType on a.machine_type equals b.id select new MachineViewModel() { id = b.id, machine_type_name = b.machine_type_name }).GroupBy(x => x.id).Select(x => x.First()).ToList(); return(data); }
public IEnumerable <MachineType> GetMachineType() { return(_machineTypeRepository.GetAll()); }
public async Task <IEnumerable <OutMachineTypeDTO> > GetMachineTypes() { var machineTypes = await _machineTypeRepository.GetAll(); return(MachineTypeMapping.MachineTypeToOutDto(machineTypes)); }
public async Task <ActionResult <IEnumerable <MachineType> > > GetMachineTypes() { return(await _machineTypeRepository.GetAll()); }