示例#1
0
        public ActionResult Create(string id)
        {
            var model = new MuonTraViewModel();

            if (string.IsNullOrEmpty(id))
            {
                return(View(model));
            }
            else
            {
                var muontra = _muonTraService.Get(m => m.Id == id);
                model = GetMuonTra(muontra);
                return(View(model));
            }
        }
示例#2
0
        public IHttpActionResult GetById(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(BadRequest());
            }

            var muontra = Mapper.Map <MuonTra, MuonTraDto>(_muonTraService.Get(p => p.Id == id));

            if (muontra == null)
            {
                return(NotFound());
            }
            return(Ok(muontra));
        }