public HttpResponseMessage GetById(int id) { Inventario items = c.GetById(id); if (items == null) { //Construyendo respuesta del servidor return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "No hay ningun Inventario con el id " + id)); } return(Request.CreateResponse(HttpStatusCode.OK, items)); }
public IActionResult Edit(int id) { var viewModel = new InventariosEditViewModel() { SucursalId = SucursalId, UsuarioId = UserId }; var inventario = _inventario.GetById(id); viewModel.DetalleInventario = GetDetalleInventario(inventario); viewModel = Mapper.Map(inventario, viewModel); return(View(viewModel)); }