public IHttpActionResult Detail(Int32 id) { PartnerViewModel viewmodel = new PartnerViewModel(); PartnerDataController dataCtrl = new PartnerDataController(); viewmodel.Data.FromModel(dataCtrl.GetItem(id)); return(Ok(viewmodel)); }
public IHttpActionResult Backend_Detail(Int32 id) { BackendPartnerViewModel viewmodel = new BackendPartnerViewModel(); PartnerDataController dataCtrl = new PartnerDataController(); PartnerPackDataController partnerPackdataCtrl = new PartnerPackDataController(); try { viewmodel.Data.FromModel(dataCtrl.GetItem(id)); viewmodel.PartnerTypeOptions = partnerPackdataCtrl.GetItems().ToList().ConvertAll(x => { return(new BackendPartnerType() { ID = x.ID, Name = x.Name }); }).OrderBy(x => x.Name).ToList(); } catch (Exception ex) { return(Error(viewmodel, ex)); } return(Ok(viewmodel)); }