public IActionResult Details(Guid?id) { if (id == null) { return(NotFound()); } try { return(View(_wasteContainerService.GetWasteContainerAsViewModel((Guid)id))); } catch (Exception ex) { _logger.LogError(ex, ex.Message); return(NotFound(ex.Message).WithError(ex.Message)); } }
public void GetWasteContainerAsViewModelTest() { var entity = _memoryDbContext.Containers.FirstOrDefault(); var entityEditModel = _wasteContainerService.GetWasteContainerAsViewModel(entity.Id); Assert.IsTrue(entity.Name == entityEditModel.Name); Assert.IsTrue(entity.Location == entityEditModel.Location); Assert.IsTrue(entity.Id == entityEditModel.Id); }