public IActionResult Delete(HoroscropeReading horoscrope, Guid Id) { var reading = _horoscopeRepository.GetAll() .FirstOrDefault(x => Id == x.Id); _horoscopeRepository.Delete(reading); return(RedirectToAction("ViewAll", "Horoscope")); }
public IActionResult Update(HoroscropeReading reading, Guid Id) { var horoscope = _horoscopeRepository.GetAll() .FirstOrDefault(x => Id == x.Id); _horoscopeRepository.Update(horoscope); _horoscopeRepository.Save(); return(RedirectToAction("ViewAll", "Horoscope")); }
public IActionResult Edit(HoroscropeReading reading, Guid Id) { var horoscropeReading = _horoscopeRepository.GetAll() .FirstOrDefault(x => Id == x.Id); horoscropeReading.Title = reading.Title; horoscropeReading.Desciption = reading.Desciption; horoscropeReading.BodyText = reading.BodyText; horoscropeReading.Created = reading.Created; _horoscopeRepository.Update(horoscropeReading); _horoscopeRepository.Save(); return(RedirectToAction("ViewAll", "Horoscope")); }
public EntityEntry <HoroscropeReading> Update(HoroscropeReading reading) { return(_context.HoroscropeReadings.Update(reading)); }
public Task <EntityEntry <HoroscropeReading> > Insert(HoroscropeReading reading) { return(_context.HoroscropeReadings.AddAsync(reading)); }
public void Delete(HoroscropeReading reading) { _context.HoroscropeReadings.Remove(reading); _context.SaveChanges(); }
public void Add(HoroscropeReading reading) { _context.HoroscropeReadings.Add(reading); _context.SaveChanges(); }
public IActionResult Create(HoroscropeReading horoscrope) { _horoscopeRepository.Add(horoscrope); return(RedirectToAction("ViewAll", "Horoscope")); }