public async Task <IActionResult> PutInternship(int id, Internship internship)
        {
            if (id != internship.InternshipId)
            {
                return(BadRequest());
            }

            _context.Entry(internship).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();

                Internship updated = _context.Internships.Find(id);
                return(Ok(new Response <Internship>(updated)));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!InternshipExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        Create(String Title, String CreateDate, IFormFile ImagePath, String Description)
        {
            News news = new News();
            //CultureInfo culture = new CultureInfo("en-US");
            DateTime createdDate = DateTime.Parse(CreateDate);

            news.Title       = Title;
            news.CreateDate  = createdDate;
            news.Description = Description;
            string upLoadFolder   = Path.Combine(hostingEnviroment.WebRootPath, "images");
            var    uniqueFileName = Guid.NewGuid().ToString() + "_" + Path.GetFileName(ImagePath.FileName);
            string filePath       = Path.Combine(upLoadFolder, uniqueFileName);

            news.ImagePath = "/images/" + uniqueFileName;
            using (var stream = System.IO.File.Create(filePath))
            {
                await ImagePath.CopyToAsync(stream);
            }
            if (ModelState.IsValid)
            {
                _context.Add(news);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(news));
        }
        public async Task <ActionResult <Internship> > DeleteInternship(int id)
        {
            var internship = await _context.Internships.FindAsync(id);

            if (internship == null)
            {
                return(NotFound());
            }

            _context.Internships.Remove(internship);
            await _context.SaveChangesAsync();

            return(internship);
        }