コード例 #1
0
        public IActionResult Get(int id, int mid)
        {
            if (!_flowRepository.FlowExist(id))
            {
                return(NotFound());
            }
            var result = _flowRepository.GetMaterialForFlow(id, mid);

            if (result == null)
            {
                return(NotFound());
            }
            //var m = result.Materials.SingleOrDefault(x => x.Id == mid);
            //if (m == null)
            //{
            //    return NotFound();
            //}
            var re = new Material {
                Id   = result.Id,
                Name = result.Name
            };

            return(Ok(new JsonResult(re)));
        }