public ActionResult Index(int id = 0) { if (id == 0) { return(View(new TPOFormulationModel())); } using (var service = new TPOFormulationService()) { TPOFormulationModel model = Mapper.Map <TPOFormulationDto, TPOFormulationModel>(service.Get(id)); return(View(model)); } }