Exemplo n.º 1
0
        public ActionResult RetrievePhotoCandidate(int id)
        {
            byte[] image;

            using (var candidateRepository = new CandidateRepository())
            {
                image = candidateRepository.GetCandidateWithPhoto(id);
            }
            if (image == null)
                return File("~/Content/Banners/NoCandidate.jpg", "image/jpg");

            return File(image, "image/png");
        }