locked
AJAX Post help, RRS feed

  • Question

  • User1545235275 posted

    Hello,

    I can't get the following query to work that searches a table for a username -  I get the error below:

    Error    7    Could not find an implementation of the query pattern for source type 'Security.User'.  'Where' not found. 

    public JsonResult Search(string test)
            {
                //var userlist = PrepareUserlist();
    
                var searchedlist =  from c in Security.User
                where test != null && c.UserName == test
                select c.UserName;
    
    
                return Json(new { Items = searchedlist });
            }

    Any ideas?

    Wednesday, November 6, 2013 7:03 AM

Answers

  • User79986525 posted

    Hi ,

    Try Somthing Like this 

    public JsonResult Search(string test)
            {
                //var userlist = PrepareUserlist();
    
                var searchedlist = ( from c in Security.User
                where test != null && c.UserName == test
                select new {UserName= c.UserName}).ToList();
    
    
                return Json(new { Items = searchedlist });
            }

    hope this will help you out 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 6, 2013 7:10 AM