public IActionResult Upload(AddGalleryImageModel model) { try { _noticeService.UploadImages(model); return(RedirectToAction("Details", new { noticeId = model.NoticeId })); } catch (Exception e) { return(StatusCode(500, e.Message)); } }
public IActionResult UploadAjax(int noticeId) { try { AddGalleryImageModel model = new AddGalleryImageModel() { NoticeId = noticeId, Images = Request.Form.Files }; var imageModels = _noticeService.UploadImages(model); return(Ok(imageModels.ToList())); } catch (Exception e) { return(StatusCode(500, e.Message)); } }