public async Task <bool> AddAsync(Publisher publisher) { try { await _context.AddAsync(publisher); await _context.SaveChangesAsync(); } catch (Exception) { return(false); } return(true); }
public async Task <bool> AddAsync(Characteristics characteristics) { try { await _context.AddAsync(characteristics); await _context.SaveChangesAsync(); } catch (Exception) { return(false); } return(true); }
public async Task <bool> AddAsync(Author author) //AddAsync { try { await _context.AddAsync(author); await _context.SaveChangesAsync(); } catch (Exception) { return(false); } return(true); }
public async Task <bool> AddAsync(Genre genre) { try { await _context.AddAsync(genre); await _context.SaveChangesAsync(); } catch (Exception) { return(false); } return(true); }
public async Task <bool> AddAsync(Category category) { try { await _context.AddAsync(category); await _context.SaveChangesAsync(); } catch (Exception) { return(false); } return(true); }
public async Task <bool> Update(User user, string password = null) { var _user = await _context.BookUsers.FindAsync(user.Id); if (_user != null) { _user.Username = user.Username; _user.FirstName = user.FirstName; _user.LastName = user.LastName; await _context.SaveChangesAsync(); return(true); } return(false); }
public async Task <bool> Update(User user, string password = null) { var users = await _context.BookUsers.FindAsync(user.Id); if (users != null) { users.FirstName = user.FirstName; users.LastName = user.LastName; users.Username = user.Username; users.Email = user.Email; users.PhoneNo = user.PhoneNo; await _context.SaveChangesAsync(); return(true); } return(false); }