public void UploadEditedFile(FileSyncContent content) { _filesRepository.EditFile(new File { Data = content.Data, Description = content.Description, FileContent = content.FileContent, FileName = content.FileName, FileType = content.FileType, Id = content.Id, UserId = content.UserId }); }
public ActionResult Edit(File file) { if (ModelState.IsValid) { //make sure the edited file has the same user profile assigned to it file.User = _usersRepository.GetUserProfileByName(User.Identity.Name.ToLower()); file.Data = DateTime.Now; //save the changes _filesRepository.EditFile(file); return(RedirectToAction("Index")); } return(View(file)); }