TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
osyris zosar
NA
289
27k
Creating multiple Page search/filtering system in best possible way
Apr 17 2021 11:15 PM
I know how to create single search on products
But how do I filter products base on multiple Fields
for example search on Title, price, brand and discription at the same time
What would be to most professional way to achive this
Single filter:
public
async Task<IActionResult> Index(
string
Title,
string
price,
string
discription
,
string
brand)
{
var products = from m
in
_context.Product
select m;
if
(!
string
.IsNullOrEmpty(Title))
{
products = _context.Product.Where(x => x.Title.ToLower().Contains(Title.ToLower()));
}
return
View(await products.ToListAsync());
}
Reply
Answers (
6
)
Get Particular Id.
Set Value in Temp Data.