public void GetWasteContainerAsEditModelTest() { var entity = _memoryDbContext.Containers.FirstOrDefault(); var entityEditModel = _wasteContainerService.GetWasteContainerAsEditModel(entity.Id); Assert.IsTrue(entity.Name == entityEditModel.Name); Assert.IsTrue(entity.Location == entityEditModel.Location); Assert.IsTrue(entity.Id == entityEditModel.Id); }
// GET: WasteContainers/Edit/Guid public IActionResult Edit(Guid?id) { if (id == null) { return(NotFound().WithError(LOCALIZATION_ERROR_NOT_FOUND)); } var wasteContainer = _wasteContainerService.GetWasteContainerAsEditModel((Guid)id); if (wasteContainer == null) { return(NotFound().WithError(LOCALIZATION_ERROR_NOT_FOUND)); } return(View(wasteContainer)); }