public IActionResult Load(long id) { var result = _providerService.GetById(id); UpdateViewModel model; if (result.HasErrors()) { model = new UpdateViewModel() { Message = result.GetFailure() }; return(View(model)); } model = new UpdateViewModel() { Id = id, Name = result.GetPayload().Name, CountryCode = result.GetPayload().Country }; return(View(model)); }
public async Task <ActionResult> GetById(string providerId) { var apiRep = new APIResponse(); var product = await _providerService.GetById(providerId); apiRep.Error = false; apiRep.Data = product; return(Ok(apiRep)); }
public ActionResult Edit(int id) { return(View(p.GetById(id))); }