public IActionResult LoadProjectImage(int projectId) { var img = projectList.GetById(projectId).Image; return((img != null) ? File(img, "image/jpg") : null); }
public void When_getting_projectWithId_returns_The_Project_With_Given_Id() { var existingProject = new Project { Id = 1 }; repoMock .Setup(r => r.Get(existingProject.Id)) .Returns(existingProject); var result = projectList.GetById(existingProject.Id); Assert.Equal(existingProject, result); }
public ActionResult Details(int id) { return(View(projectList.GetById(id))); }