public ActionResult Modify(MeetingViewModel meetingModel)
        {


            if (ModelState.IsValid)
            {
                List<FileDto> FileList = new List<FileDto>();
                if (Session["FileList"] != null)
                {
                    FileList = Session["FileList"] as List<FileDto>;
                }
                if (Session["OldFiles"] != null)
                {
                    var OldFiles = Session["OldFiles"] as List<FileViewModel>;
                    foreach (var item in OldFiles)
                    {
                        string strdocPath = Server.MapPath("/Download/" + item.FileName);
                        FileStream objfilestream = new FileStream(strdocPath, FileMode.Open, FileAccess.Read);
                        int len = (int)objfilestream.Length;
                        Byte[] documentcontents = new Byte[len];
                        objfilestream.Read(documentcontents, 0, len);
                        objfilestream.Close();
                        var str = Convert.ToBase64String(documentcontents);
                        FileDto OldFile = new FileDto()
                        {
                            ContentType = System.IO.Path.GetExtension(item.FileName),
                            Content = str
                        };
                        FileList.Add(OldFile);
                    }
                }
                //foreach (var item in files)
                //{
                //    if (item !=null)
                //    {
                //        MemoryStream target = new MemoryStream();
                //        item.InputStream.CopyTo(target);
                //        byte[] data = target.ToArray();
                //        var str = Convert.ToBase64String(data);
                //        FileDto File = new FileDto()
                //        {
                //            ContentType = System.IO.Path.GetExtension(item.FileName),
                //            Content = str
                //        };
                //        FileList.Add(File);
                //    }
                //}
                var meetingDto = mapToMeetingDto(meetingModel);
                meetingDto.Files = FileList;
                HttpClientHelper.Put(apiUri, endpoint, meetingDto);
                Session.Remove("FileList");
                Session.Remove("OldFiles");

                return RedirectToAction("Index");
            }
            return View(meetingModel);
        }
        public ActionResult SaveUploadedFile()
        {
            bool isSavedSuccessfully = true;
            try
            {
                List<FileDto> FileList = new List<FileDto>();
                if (Session["FileList"] != null)
                {
                    FileList = Session["FileList"] as List<FileDto>;
                }
                foreach (string fileName in Request.Files)
                {
                    HttpPostedFileBase file = Request.Files[fileName];
                    MemoryStream target = new MemoryStream();
                    file.InputStream.CopyTo(target);
                    byte[] data = target.ToArray();
                    try
                    {

                        using (MagickImage image = new MagickImage())
                        {
                            image.Read(target);
                            image.Resize(800, 0);
                            data = image.ToByteArray();
                        }
                    }
                    catch
                    {

                    }

                    var str = Convert.ToBase64String(data);
                    FileDto FileUpload = new FileDto()
                    {
                        ContentType = System.IO.Path.GetExtension(file.FileName),
                        Content = str
                    };
                    //Byte[] docbinaryarray = Convert.FromBase64String(FileUpload.Content);
                    //string strdocPath = "C:\\DocumentDirectory2\\" + file.FileName + FileUpload.ContentType;
                    //FileStream objfilestream = new FileStream(strdocPath, FileMode.Create, FileAccess.ReadWrite);
                    //objfilestream.Write(docbinaryarray, 0, docbinaryarray.Length);
                    //objfilestream.Close();
                    FileList.Add(FileUpload);
                }
                Session["FileList"] = FileList;

            }
            catch (Exception ex)
            {
                isSavedSuccessfully = false;
            }


            if (isSavedSuccessfully)
            {
                return Json(new { Message = "فایل با موفقیت آپلود شد" });
            }
            else
            {
                return Json(new { Message = "خطا در آپلود فایل" });
            }
        }
        public static void AreEqual_FileDto(FileDto expect, FileDto actual)
        {
            Assert.AreEqual(expect.ContentType, actual.ContentType);
            Assert.AreEqual(expect.Content, actual.Content);

        }