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)); } }
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)); }