public async Task <IActionResult> postad(AdvertisementModel model)
        {
            if (ModelState.IsValid)
            {
                model.Userid = _userService.GetUserId();
                if (model.GalleryFiles != null)
                {
                    string folder = "advertisement/gallery/";

                    model.Gallery = new List <GalleryModel>();

                    foreach (var file in model.GalleryFiles)
                    {
                        var gallery = new GalleryModel()
                        {
                            Name = file.FileName,
                            URL  = await UploadImage(folder, file),
                        };
                        model.Gallery.Add(gallery);
                    }
                }
                var id = await _advertisementRepository.AddNewAdvertisement(model);

                if (id > 0)
                {
                    return(RedirectToAction(nameof(managead), new { UserId = 0 }));
                }
            }


            return(View());
        }