コード例 #1
0
        public ActionResult <OperationsTypeDTO> GetOperationsTypeByID(int id)
        {
            var opType          = _IOperationsTypeRepository.Select(id);
            OperationsTypeDTO p = OperationsTypeDTO.generateDto(opType);

            return(Ok(p));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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);
        }