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
Madhav Sharma
889
899
39.3k
Need search during infinite loading of data
Dec 23 2019 2:09 AM
I need help,
Here the problem is that I want to make an API for the app, during scroll I can search the data. In the below code, I am able to do Infinite scroll but not sure how to give search functionality. For example, I have a scroll 3 pages (1 page have 10 records) and during that time I want to search string like "David" so it will give search string within 30 records
public dynamic GetAllUsersList(int Count, int UserId)
{
using (LystenEntities db = new LystenEntities())
{
OnlineUserViewModel uv = new OnlineUserViewModel();
uv.TotalCount = db.User_Master.Where(x => x.IsActive == true).Where(x => x.RoleId != 1 && x.Id != UserId).ToList().Count();
int skip = 10 * Count;
string baseURL = HttpContext.Current.Request.Url.Authority;
baseURL += (WebConfigurationManager.AppSettings["userimagepath"]).Replace("~", "");
uv.userdetail =
db.User_Master.Where(x => x.RoleId != 1 && x.Id != UserId && x.IsActive == true).Select(x => new userdetail()
{
Id = x.Id,
Email = x.Email,
Displayname = x.FullName == null ? "" : x.FullName,
Image = (x.Image == null) ? "" : x.Image == "" ? "" : (baseURL + x.Image)
}).OrderBy(x => x.Displayname).Skip(skip).Take(10).ToList();
return uv;
}
}
Reply
Answers (
1
)
IConfiguration not working
How to detect which datbase view that is used