public async Task <JsonResult> Update(int id, ProfessorRequestViewModel viewRequest) { ProfessorRequestModel request = Mapper.Map <ProfessorRequestModel>(viewRequest); ProfessorResponseModel response = await studentSystemApi.Execute(professorsClient.UpdateAsync, id, request); ProfessorResponseViewModel viewResponse = Mapper.Map <ProfessorResponseViewModel>(response); return(Json(viewResponse)); }
public async Task <JsonResult> Get(int id) { ProfessorResponseModel response = await studentSystemApi.Execute(professorsClient.GetAsync, id); if (response == null) { return(Json(new ProfessorResponseViewModel(), JsonRequestBehavior.AllowGet)); } ProfessorResponseViewModel viewResponse = Mapper.Map <ProfessorResponseViewModel>(response); return(Json(viewResponse, JsonRequestBehavior.AllowGet)); }