public override bool NotAttachmentsUser(int userID, int bookID) { UserBook userBook = UserBook.Find(x => x.User.ID == userID && x.Book.ID == bookID); if (userBook != null) { userBook.DateTimeEnd = DateTime.Now.Date; return(true); } return(false); }
public override bool AttachmentsUser(int userid, int bookid) { if (UserBook.Find(x => x.Book.ID == bookid) == null) { User user = User.Find(x => x.ID == userid); Book book = Book.Find(x => x.ID == bookid); UserBook.Add(new UserBook() { User = user, Book = book, DateTimeStart = DateTime.Now.Date, ID = UserBook.Count }); return(true); } return(false); }