public IActionResult AddBlogPhoto(IFormFile img, long blogId) { if (img == null) { return(RedirectToActionPermanent("ShowBlogWith", "Blog", new { blogId = blogId })); } var ms = new MemoryStream(); img.CopyTo(ms); mediaService.AddBlogPhoto(ms, blogId); return(RedirectToActionPermanent("ShowBlogWith", "Blog", new { blogId = blogId })); }