public async Task <ActionResult <ProductBook> > DeleteProductBook(string id) { var productBook = await _context.ProductBooks.FindAsync(id); ChangeLog.AddDeletedLog(_context, "Books", productBook); if (productBook == null) { return(NotFound()); } _context.ProductBooks.Remove(productBook); await _context.SaveChangesAsync(); return(productBook); }
public async Task <ActionResult <User> > DeleteUser(Guid id) { var user = await _context.Users.FindAsync(id); ChangeLog.AddDeletedLog(_context, "Users", user); if (user == null) { return(NotFound()); } _context.Users.Remove(user); await _context.SaveChangesAsync(); return(user); }
public async Task <ActionResult <TableConsecutive> > DeleteTableConsecutive(Guid id) { var tableConsecutive = await _context.TableConsecutives.FindAsync(id); ChangeLog.AddDeletedLog(_context, "TableConsecutives", tableConsecutive); if (tableConsecutive == null) { return(NotFound()); } _context.TableConsecutives.Remove(tableConsecutive); await _context.SaveChangesAsync(); return(tableConsecutive); }
public async Task <ActionResult <ProductBookSubject> > DeleteProductBookSubject(Guid id) { var productBookSubject = await _context.ProductBookSubjects.FindAsync(id); ChangeLog.AddDeletedLog(_context, "BookSubjects", productBookSubject); if (productBookSubject == null) { return(NotFound()); } _context.ProductBookSubjects.Remove(productBookSubject); await _context.SaveChangesAsync(); return(productBookSubject); }
public async Task <ActionResult <ProductSongGenre> > DeleteProductSongGenre(Guid id) { var productSongGenre = await _context.ProductSongGenres.FindAsync(id); ChangeLog.AddDeletedLog(_context, "SongGenres", productSongGenre); if (productSongGenre == null) { return(NotFound()); } _context.ProductSongGenres.Remove(productSongGenre); await _context.SaveChangesAsync(); return(productSongGenre); }
public async Task <ActionResult <ProductMovieActor> > DeleteProductMovieActor(Guid id) { var productMovieActor = await _context.ProductMovieActors.FindAsync(id); ChangeLog.AddDeletedLog(_context, "MovieActors", productMovieActor); if (productMovieActor == null) { return(NotFound()); } _context.ProductMovieActors.Remove(productMovieActor); await _context.SaveChangesAsync(); return(productMovieActor); }
public async Task <ActionResult <SystemConfiguration> > DeleteSystemConfiguration(Guid id) { var systemConfiguration = await _context.SystemConfigurations.FindAsync(id); ChangeLog.AddDeletedLog(_context, "SystemConfigurations", systemConfiguration); if (systemConfiguration == null) { return(NotFound()); } _context.SystemConfigurations.Remove(systemConfiguration); await _context.SaveChangesAsync(); return(systemConfiguration); }