Example #1
0
 public IActionResult AddNewItem(DataAccessLayer.Models.File file)
 {
     if (ModelState.IsValid)
     {
         fileRepository.Add(file);
         fileRepository.Save();
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View());
     }
 }
Example #2
0
 public Models.ViewModels.vw_File MapToFileViewModel(DataAccessLayer.Models.File map)
 {
     return(new Models.ViewModels.vw_File()
     {
         Id = map.Id,
         Content = map.Content,
         CreateDateTime = map.CreateDateTime,
         FileExtension = map.FileExtension,
         FileSize = map.FileSize,
         Title = map.Title,
         LastModified = map.LastModified
     });
 }
Example #3
0
 public IActionResult UpdateItem(DataAccessLayer.Models.File file)
 {
     fileRepository.Update(file);
     fileRepository.Save();
     return(RedirectToAction("Index"));
 }