public IActionResult UpdateBasic(int id, UpdateBasicSingerViewModel model) { var singer = _singerAppService.GetSingerById(id); model = new UpdateBasicSingerViewModel() { Id = singer.Id, Name = singer.Name, ForeignName = singer.ForeignName, Nationality = singer.Nationality }; return(PartialView("_UpdateBasic", model)); }
private string SaveMusicFile(IFormFile file, int singerId, int albumId) { var singer = _singerAppService.GetSingerById(singerId); var album = _albumAppService.GetAlbumById(albumId); var fileName = FileHelper.GetFullFileNameOfMusic(file.ContentDisposition, singer, album); if (!EntityFramework.Persistences.GlobalHelper.IsEffectiveMusicFile(fileName)) { throw new JMBasicException("文件无效"); } if (file.SaveTo(fileName)) { return(fileName); } throw new JMBasicException("文件上传失败"); }