Example #1
0
        public async Task <ActionResult> ReparseCoverFilename()
        {
            try
            {
                CoverModel        updateCover;
                List <CoverModel> allCover = doruDB.Cover.ToList();
                ReadWriteFile.ParseCoverFilename(allCover);

                foreach (var cover in allCover)
                {
                    //var cover = await doruDB.Cover.FindAsync(id);
                    updateCover = await doruDB.Cover.FindAsync(cover.Id);

                    updateCover = cover;
                    doruDB.Cover.Update(updateCover);
                }
                await doruDB.SaveChangesAsync();

                return(NoContent());
            }
            catch (Exception e)
            {
                throw e;
            }
        }