public void Add(ResortPost newpost) { newpost.Id = _nextId++; _ResortRepoFs.Add(newpost); SaveFile(); }
public void Delete(ResortPost newpost) { var origResortPost = GetById(newpost.Id); _ResortRepoFs.Remove(origResortPost); SaveFile(); }
public void Edit(ResortPost newpost) { var newResortPost = GetById(newpost.Id); newResortPost.Permalink = newpost.Permalink; newResortPost.PhotoUrl = newpost.PhotoUrl; newResortPost.PostContent = newpost.PostContent; newResortPost.Title = newpost.Title; newResortPost.Author = newpost.Author; }
public void Update(ResortPost newpost) { var newResortPost = GetById(newpost.Id); newResortPost.Permalink = newpost.Permalink; newResortPost.PhotoUrl = newpost.PhotoUrl; newResortPost.PostContent = newpost.PostContent; newResortPost.Title = newpost.Title; newResortPost.Author = newpost.Author; SaveFile(); }
public ActionResult Delete(int id, ResortPost ResortPostDelete) { try { _ResortPostRepo.Delete(ResortPostDelete); return(RedirectToAction(nameof(Index))); } catch (Exception) { // TODO Log the exception } return(View(ResortPostDelete)); }
public ActionResult Edit(int id, ResortPost editedResortPost) { try { _ResortPostRepo.Update(editedResortPost); return(RedirectToAction(nameof(Index))); } catch (Exception) { // TODO Log the exception } return(View(editedResortPost)); }
public ActionResult Create(ResortPost newResortPost) { try { if (ModelState.IsValid) { _ResortPostRepo.Add(newResortPost); return(RedirectToAction(nameof(Index))); } } catch (Exception ex) { } return(View(newResortPost)); }
public void Details(ResortPost newpost) { throw new NotImplementedException(); }
public void Delete(ResortPost newPostDelete) { var origResortPost = GetById(newPostDelete.Id); _ResortPost.Remove(origResortPost); }
public void Add(ResortPost newResortPost) { newResortPost.Id = _nextId++; _ResortPost.Add(newResortPost); }
public void Update(ResortPost newpost) { _dbContext.ResortPosts.Update(newpost); _dbContext.SaveChanges(); }
public void Delete(ResortPost newpost) { _dbContext.ResortPosts.Remove(newpost); _dbContext.SaveChanges(); }
public void Add(ResortPost newResortPost) { _dbContext.ResortPosts.Add(newResortPost); _dbContext.SaveChanges(); }