public IQueryable <Book> GetBooks(string title, string author, string isbn) { var query = ReadData.AsQueryable(); if (!string.IsNullOrEmpty(title)) { query = query.Where(x => x.title == title).AsQueryable(); } if (!string.IsNullOrEmpty(author)) { query = query.Where(x => x.author == author).AsQueryable(); } if (!string.IsNullOrEmpty(isbn)) { query = query.Where(x => x.isbn == isbn).AsQueryable(); } return(query); }
public IQueryable <Book> GetBook() => ReadData.AsQueryable();