public ActionResult <OperationsTypeDTO> GetOperationsTypeByID(int id) { var opType = _IOperationsTypeRepository.Select(id); OperationsTypeDTO p = OperationsTypeDTO.generateDto(opType); return(Ok(p)); }
public ActionResult <OperationsTypeDTO> PostOperationsType(OperationsTypeDTO operationsTypeDTO) { OperationsType opType = new OperationsType(new Designation(operationsTypeDTO.designation)); _IOperationsTypeRepository.Insert(opType); return(CreatedAtAction(nameof(GetAllOperationsType), new { id = opType.Id }, opType)); }
public List <OperationsTypeDTO> GetAllOperationsType() { var q = _IOperationsTypeRepository.SelectAll().ToList(); List <OperationsTypeDTO> list = new List <OperationsTypeDTO>(); foreach (OperationsType p in q) { list.Add(OperationsTypeDTO.generateDto(p)); } return(list); }