How to Search in List











up vote
0
down vote

favorite












I have a List<string> that has some items look like this in my View:



1S61A9MAT1DKV5N74925,
1S61A9MAT1DKV5X49329,
1S61A9MAT1DKV5X49857


and i want search efter this items , but to be honest i don't know what should i tell my Controller,when its comes List<string> i tried something like this in my controllers.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString) but its not worked , i mean when i search for this item 1S61A9MAT1DKV5N74925 it can pass the value to controller ,but it cant find any results for that item i searched. and as you see in my
Contorller i have some Property which is string and there is one which is List<string> ' SerialNoInvoiceOrdrelineDeliveryCloses '



Controller:



 public ActionResult test(string searchString) {

string EmailID = Session["Email"].ToString();

var v = (from cbr in db.Contact_Business_Relation
join c in db.Contact on cbr.Contact_No_ equals c.Company_No_
join sih in db.Sales_Invoice_Line on sa.No_ equals sih.Document_No_
where c.E_Mail == EmailID

select new ClosedOrders
{
OrderNumber = sa.Order_No_,
Fakturanummer = sih.Document_No_,
varnummer = sih.No_,

//List<string>
SerialNoInvoiceOrdrelineDeliveryCloses = db.Item_Ledger_Entry
.Where(s => s.Item_No_ == sih.No_)
.Select(s => s.Serial_No_)
.ToList()
});

if (searchString !=null)
{
v = v.Where(s => s.OrderNumber.Contains(searchString)
|| s.Fakturanummer.Contains(searchString)
|| s.varnummer.Contains(searchString)
|| s.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString)
);
}
return View(v);
}


ViewModel :



public class ClosedOrders
{
public string OrderNumber { get; set; }
public string Fakturanummer { get; set; }
public List<string> SerialNoInvoiceOrdrelineDeliveryCloses { get; set; }
public string varnummer { get; set; }
}


View:



@using (Html.BeginForm("test", "Account", FormMethod.Get))
{
<p>
Find by name: @Html.TextBox("SearchString")
<input type="submit" value="Search" />
</p>
}

//Loop Model
foreach (var item in Model)
{
<tr>
<td>
@item.Fakturanummer
</td>
<td>
@item.OrderNumber
</td>
<td> @item.varnummer</td>
<td>
@String.Join(", ", item.SerialNoInvoiceOrdrelineDeliveryCloses)
</td>
</tr>
}









share|improve this question




















  • 1




    You should not pass IQueryable to viewer. I suggest you put a .ToList() at the end of your queries.
    – roozbeh S
    Nov 11 at 12:25










  • @roozbehS you are right ,dat was the cause all the problems IQueryable , when i tried pass IQueryable to view and i changed .ToList() everything get it work :) Merci koliii Roozbeh :) if you like postet as anwser and i will mark as right anwser
    – The First
    Nov 11 at 12:46










  • Glad I could help. Added an answer.
    – roozbeh S
    Nov 11 at 20:24















up vote
0
down vote

favorite












I have a List<string> that has some items look like this in my View:



1S61A9MAT1DKV5N74925,
1S61A9MAT1DKV5X49329,
1S61A9MAT1DKV5X49857


and i want search efter this items , but to be honest i don't know what should i tell my Controller,when its comes List<string> i tried something like this in my controllers.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString) but its not worked , i mean when i search for this item 1S61A9MAT1DKV5N74925 it can pass the value to controller ,but it cant find any results for that item i searched. and as you see in my
Contorller i have some Property which is string and there is one which is List<string> ' SerialNoInvoiceOrdrelineDeliveryCloses '



Controller:



 public ActionResult test(string searchString) {

string EmailID = Session["Email"].ToString();

var v = (from cbr in db.Contact_Business_Relation
join c in db.Contact on cbr.Contact_No_ equals c.Company_No_
join sih in db.Sales_Invoice_Line on sa.No_ equals sih.Document_No_
where c.E_Mail == EmailID

select new ClosedOrders
{
OrderNumber = sa.Order_No_,
Fakturanummer = sih.Document_No_,
varnummer = sih.No_,

//List<string>
SerialNoInvoiceOrdrelineDeliveryCloses = db.Item_Ledger_Entry
.Where(s => s.Item_No_ == sih.No_)
.Select(s => s.Serial_No_)
.ToList()
});

if (searchString !=null)
{
v = v.Where(s => s.OrderNumber.Contains(searchString)
|| s.Fakturanummer.Contains(searchString)
|| s.varnummer.Contains(searchString)
|| s.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString)
);
}
return View(v);
}


ViewModel :



public class ClosedOrders
{
public string OrderNumber { get; set; }
public string Fakturanummer { get; set; }
public List<string> SerialNoInvoiceOrdrelineDeliveryCloses { get; set; }
public string varnummer { get; set; }
}


View:



@using (Html.BeginForm("test", "Account", FormMethod.Get))
{
<p>
Find by name: @Html.TextBox("SearchString")
<input type="submit" value="Search" />
</p>
}

//Loop Model
foreach (var item in Model)
{
<tr>
<td>
@item.Fakturanummer
</td>
<td>
@item.OrderNumber
</td>
<td> @item.varnummer</td>
<td>
@String.Join(", ", item.SerialNoInvoiceOrdrelineDeliveryCloses)
</td>
</tr>
}









share|improve this question




















  • 1




    You should not pass IQueryable to viewer. I suggest you put a .ToList() at the end of your queries.
    – roozbeh S
    Nov 11 at 12:25










  • @roozbehS you are right ,dat was the cause all the problems IQueryable , when i tried pass IQueryable to view and i changed .ToList() everything get it work :) Merci koliii Roozbeh :) if you like postet as anwser and i will mark as right anwser
    – The First
    Nov 11 at 12:46










  • Glad I could help. Added an answer.
    – roozbeh S
    Nov 11 at 20:24













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a List<string> that has some items look like this in my View:



1S61A9MAT1DKV5N74925,
1S61A9MAT1DKV5X49329,
1S61A9MAT1DKV5X49857


and i want search efter this items , but to be honest i don't know what should i tell my Controller,when its comes List<string> i tried something like this in my controllers.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString) but its not worked , i mean when i search for this item 1S61A9MAT1DKV5N74925 it can pass the value to controller ,but it cant find any results for that item i searched. and as you see in my
Contorller i have some Property which is string and there is one which is List<string> ' SerialNoInvoiceOrdrelineDeliveryCloses '



Controller:



 public ActionResult test(string searchString) {

string EmailID = Session["Email"].ToString();

var v = (from cbr in db.Contact_Business_Relation
join c in db.Contact on cbr.Contact_No_ equals c.Company_No_
join sih in db.Sales_Invoice_Line on sa.No_ equals sih.Document_No_
where c.E_Mail == EmailID

select new ClosedOrders
{
OrderNumber = sa.Order_No_,
Fakturanummer = sih.Document_No_,
varnummer = sih.No_,

//List<string>
SerialNoInvoiceOrdrelineDeliveryCloses = db.Item_Ledger_Entry
.Where(s => s.Item_No_ == sih.No_)
.Select(s => s.Serial_No_)
.ToList()
});

if (searchString !=null)
{
v = v.Where(s => s.OrderNumber.Contains(searchString)
|| s.Fakturanummer.Contains(searchString)
|| s.varnummer.Contains(searchString)
|| s.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString)
);
}
return View(v);
}


ViewModel :



public class ClosedOrders
{
public string OrderNumber { get; set; }
public string Fakturanummer { get; set; }
public List<string> SerialNoInvoiceOrdrelineDeliveryCloses { get; set; }
public string varnummer { get; set; }
}


View:



@using (Html.BeginForm("test", "Account", FormMethod.Get))
{
<p>
Find by name: @Html.TextBox("SearchString")
<input type="submit" value="Search" />
</p>
}

//Loop Model
foreach (var item in Model)
{
<tr>
<td>
@item.Fakturanummer
</td>
<td>
@item.OrderNumber
</td>
<td> @item.varnummer</td>
<td>
@String.Join(", ", item.SerialNoInvoiceOrdrelineDeliveryCloses)
</td>
</tr>
}









share|improve this question















I have a List<string> that has some items look like this in my View:



1S61A9MAT1DKV5N74925,
1S61A9MAT1DKV5X49329,
1S61A9MAT1DKV5X49857


and i want search efter this items , but to be honest i don't know what should i tell my Controller,when its comes List<string> i tried something like this in my controllers.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString) but its not worked , i mean when i search for this item 1S61A9MAT1DKV5N74925 it can pass the value to controller ,but it cant find any results for that item i searched. and as you see in my
Contorller i have some Property which is string and there is one which is List<string> ' SerialNoInvoiceOrdrelineDeliveryCloses '



Controller:



 public ActionResult test(string searchString) {

string EmailID = Session["Email"].ToString();

var v = (from cbr in db.Contact_Business_Relation
join c in db.Contact on cbr.Contact_No_ equals c.Company_No_
join sih in db.Sales_Invoice_Line on sa.No_ equals sih.Document_No_
where c.E_Mail == EmailID

select new ClosedOrders
{
OrderNumber = sa.Order_No_,
Fakturanummer = sih.Document_No_,
varnummer = sih.No_,

//List<string>
SerialNoInvoiceOrdrelineDeliveryCloses = db.Item_Ledger_Entry
.Where(s => s.Item_No_ == sih.No_)
.Select(s => s.Serial_No_)
.ToList()
});

if (searchString !=null)
{
v = v.Where(s => s.OrderNumber.Contains(searchString)
|| s.Fakturanummer.Contains(searchString)
|| s.varnummer.Contains(searchString)
|| s.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString)
);
}
return View(v);
}


ViewModel :



public class ClosedOrders
{
public string OrderNumber { get; set; }
public string Fakturanummer { get; set; }
public List<string> SerialNoInvoiceOrdrelineDeliveryCloses { get; set; }
public string varnummer { get; set; }
}


View:



@using (Html.BeginForm("test", "Account", FormMethod.Get))
{
<p>
Find by name: @Html.TextBox("SearchString")
<input type="submit" value="Search" />
</p>
}

//Loop Model
foreach (var item in Model)
{
<tr>
<td>
@item.Fakturanummer
</td>
<td>
@item.OrderNumber
</td>
<td> @item.varnummer</td>
<td>
@String.Join(", ", item.SerialNoInvoiceOrdrelineDeliveryCloses)
</td>
</tr>
}






c# linq






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 12:05









D-Shih

24.6k61431




24.6k61431










asked Nov 11 at 11:45









The First

406




406








  • 1




    You should not pass IQueryable to viewer. I suggest you put a .ToList() at the end of your queries.
    – roozbeh S
    Nov 11 at 12:25










  • @roozbehS you are right ,dat was the cause all the problems IQueryable , when i tried pass IQueryable to view and i changed .ToList() everything get it work :) Merci koliii Roozbeh :) if you like postet as anwser and i will mark as right anwser
    – The First
    Nov 11 at 12:46










  • Glad I could help. Added an answer.
    – roozbeh S
    Nov 11 at 20:24














  • 1




    You should not pass IQueryable to viewer. I suggest you put a .ToList() at the end of your queries.
    – roozbeh S
    Nov 11 at 12:25










  • @roozbehS you are right ,dat was the cause all the problems IQueryable , when i tried pass IQueryable to view and i changed .ToList() everything get it work :) Merci koliii Roozbeh :) if you like postet as anwser and i will mark as right anwser
    – The First
    Nov 11 at 12:46










  • Glad I could help. Added an answer.
    – roozbeh S
    Nov 11 at 20:24








1




1




You should not pass IQueryable to viewer. I suggest you put a .ToList() at the end of your queries.
– roozbeh S
Nov 11 at 12:25




You should not pass IQueryable to viewer. I suggest you put a .ToList() at the end of your queries.
– roozbeh S
Nov 11 at 12:25












@roozbehS you are right ,dat was the cause all the problems IQueryable , when i tried pass IQueryable to view and i changed .ToList() everything get it work :) Merci koliii Roozbeh :) if you like postet as anwser and i will mark as right anwser
– The First
Nov 11 at 12:46




@roozbehS you are right ,dat was the cause all the problems IQueryable , when i tried pass IQueryable to view and i changed .ToList() everything get it work :) Merci koliii Roozbeh :) if you like postet as anwser and i will mark as right anwser
– The First
Nov 11 at 12:46












Glad I could help. Added an answer.
– roozbeh S
Nov 11 at 20:24




Glad I could help. Added an answer.
– roozbeh S
Nov 11 at 20:24












2 Answers
2






active

oldest

votes

















up vote
0
down vote



accepted










The problem is you are sending v as IQueryable<ClosedOrders> to the view. It is a bad practice to pass an IQueryable to a view and have it run the query. First because you are sending unresolved query to the end point, Second you need to add related references to your view code. I suggest you add .ToList() at the end of your query and send the list to the view:



var v = (from cbr in db.Contact_Business_Relation
join c in db.Contact on cbr.Contact_No_ equals c.Company_No_
join sih in db.Sales_Invoice_Line on sa.No_ equals sih.Document_No_
where c.E_Mail == EmailID

select new ClosedOrders
{
OrderNumber = sa.Order_No_,
Fakturanummer = sih.Document_No_,
varnummer = sih.No_,

//List<string>
SerialNoInvoiceOrdrelineDeliveryCloses = db.Item_Ledger_Entry
.Where(s => s.Item_No_ == sih.No_)
.Select(s => s.Serial_No_)
.ToList()
}).ToList();


and:



v = v.Where(s => s.OrderNumber.Contains(searchString) 
|| s.Fakturanummer.Contains(searchString)
|| s.varnummer.Contains(searchString)
|| s.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString)
).ToList();





share|improve this answer




























    up vote
    1
    down vote













    The direct answer might be



    // || s.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString) 
    || s.SerialNoInvoiceOrdrelineDeliveryCloses.Any(x => x.Contains(searchString))





    share|improve this answer





















    • i changed to || s.SerialNoInvoiceOrdrelineDeliveryCloses.Any(x => x.Contains(searchString)) and then browser still loading and than i get this error: System.ComponentModel.Win32Exception: The waiting action was temporarily interrupted
      – The First
      Nov 11 at 12:10










    • That sounds like a completely different problem, possibly the db.Item_Ledger_Entry subquery.
      – Henk Holterman
      Nov 11 at 12:49






    • 1




      Using a Browser slows you down - write Unit Test for this action and use the debugger.
      – Henk Holterman
      Nov 11 at 12:52










    • it was something else i was passing IQueryable to viewer and it was why i get all dis errors , anyway thanks for help .Any() and .Contains() both working :)
      – The First
      Nov 11 at 12:55











    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248415%2fhow-to-search-in-liststring%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    The problem is you are sending v as IQueryable<ClosedOrders> to the view. It is a bad practice to pass an IQueryable to a view and have it run the query. First because you are sending unresolved query to the end point, Second you need to add related references to your view code. I suggest you add .ToList() at the end of your query and send the list to the view:



    var v = (from cbr in db.Contact_Business_Relation
    join c in db.Contact on cbr.Contact_No_ equals c.Company_No_
    join sih in db.Sales_Invoice_Line on sa.No_ equals sih.Document_No_
    where c.E_Mail == EmailID

    select new ClosedOrders
    {
    OrderNumber = sa.Order_No_,
    Fakturanummer = sih.Document_No_,
    varnummer = sih.No_,

    //List<string>
    SerialNoInvoiceOrdrelineDeliveryCloses = db.Item_Ledger_Entry
    .Where(s => s.Item_No_ == sih.No_)
    .Select(s => s.Serial_No_)
    .ToList()
    }).ToList();


    and:



    v = v.Where(s => s.OrderNumber.Contains(searchString) 
    || s.Fakturanummer.Contains(searchString)
    || s.varnummer.Contains(searchString)
    || s.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString)
    ).ToList();





    share|improve this answer

























      up vote
      0
      down vote



      accepted










      The problem is you are sending v as IQueryable<ClosedOrders> to the view. It is a bad practice to pass an IQueryable to a view and have it run the query. First because you are sending unresolved query to the end point, Second you need to add related references to your view code. I suggest you add .ToList() at the end of your query and send the list to the view:



      var v = (from cbr in db.Contact_Business_Relation
      join c in db.Contact on cbr.Contact_No_ equals c.Company_No_
      join sih in db.Sales_Invoice_Line on sa.No_ equals sih.Document_No_
      where c.E_Mail == EmailID

      select new ClosedOrders
      {
      OrderNumber = sa.Order_No_,
      Fakturanummer = sih.Document_No_,
      varnummer = sih.No_,

      //List<string>
      SerialNoInvoiceOrdrelineDeliveryCloses = db.Item_Ledger_Entry
      .Where(s => s.Item_No_ == sih.No_)
      .Select(s => s.Serial_No_)
      .ToList()
      }).ToList();


      and:



      v = v.Where(s => s.OrderNumber.Contains(searchString) 
      || s.Fakturanummer.Contains(searchString)
      || s.varnummer.Contains(searchString)
      || s.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString)
      ).ToList();





      share|improve this answer























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        The problem is you are sending v as IQueryable<ClosedOrders> to the view. It is a bad practice to pass an IQueryable to a view and have it run the query. First because you are sending unresolved query to the end point, Second you need to add related references to your view code. I suggest you add .ToList() at the end of your query and send the list to the view:



        var v = (from cbr in db.Contact_Business_Relation
        join c in db.Contact on cbr.Contact_No_ equals c.Company_No_
        join sih in db.Sales_Invoice_Line on sa.No_ equals sih.Document_No_
        where c.E_Mail == EmailID

        select new ClosedOrders
        {
        OrderNumber = sa.Order_No_,
        Fakturanummer = sih.Document_No_,
        varnummer = sih.No_,

        //List<string>
        SerialNoInvoiceOrdrelineDeliveryCloses = db.Item_Ledger_Entry
        .Where(s => s.Item_No_ == sih.No_)
        .Select(s => s.Serial_No_)
        .ToList()
        }).ToList();


        and:



        v = v.Where(s => s.OrderNumber.Contains(searchString) 
        || s.Fakturanummer.Contains(searchString)
        || s.varnummer.Contains(searchString)
        || s.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString)
        ).ToList();





        share|improve this answer












        The problem is you are sending v as IQueryable<ClosedOrders> to the view. It is a bad practice to pass an IQueryable to a view and have it run the query. First because you are sending unresolved query to the end point, Second you need to add related references to your view code. I suggest you add .ToList() at the end of your query and send the list to the view:



        var v = (from cbr in db.Contact_Business_Relation
        join c in db.Contact on cbr.Contact_No_ equals c.Company_No_
        join sih in db.Sales_Invoice_Line on sa.No_ equals sih.Document_No_
        where c.E_Mail == EmailID

        select new ClosedOrders
        {
        OrderNumber = sa.Order_No_,
        Fakturanummer = sih.Document_No_,
        varnummer = sih.No_,

        //List<string>
        SerialNoInvoiceOrdrelineDeliveryCloses = db.Item_Ledger_Entry
        .Where(s => s.Item_No_ == sih.No_)
        .Select(s => s.Serial_No_)
        .ToList()
        }).ToList();


        and:



        v = v.Where(s => s.OrderNumber.Contains(searchString) 
        || s.Fakturanummer.Contains(searchString)
        || s.varnummer.Contains(searchString)
        || s.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString)
        ).ToList();






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 11 at 20:23









        roozbeh S

        6961410




        6961410
























            up vote
            1
            down vote













            The direct answer might be



            // || s.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString) 
            || s.SerialNoInvoiceOrdrelineDeliveryCloses.Any(x => x.Contains(searchString))





            share|improve this answer





















            • i changed to || s.SerialNoInvoiceOrdrelineDeliveryCloses.Any(x => x.Contains(searchString)) and then browser still loading and than i get this error: System.ComponentModel.Win32Exception: The waiting action was temporarily interrupted
              – The First
              Nov 11 at 12:10










            • That sounds like a completely different problem, possibly the db.Item_Ledger_Entry subquery.
              – Henk Holterman
              Nov 11 at 12:49






            • 1




              Using a Browser slows you down - write Unit Test for this action and use the debugger.
              – Henk Holterman
              Nov 11 at 12:52










            • it was something else i was passing IQueryable to viewer and it was why i get all dis errors , anyway thanks for help .Any() and .Contains() both working :)
              – The First
              Nov 11 at 12:55















            up vote
            1
            down vote













            The direct answer might be



            // || s.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString) 
            || s.SerialNoInvoiceOrdrelineDeliveryCloses.Any(x => x.Contains(searchString))





            share|improve this answer





















            • i changed to || s.SerialNoInvoiceOrdrelineDeliveryCloses.Any(x => x.Contains(searchString)) and then browser still loading and than i get this error: System.ComponentModel.Win32Exception: The waiting action was temporarily interrupted
              – The First
              Nov 11 at 12:10










            • That sounds like a completely different problem, possibly the db.Item_Ledger_Entry subquery.
              – Henk Holterman
              Nov 11 at 12:49






            • 1




              Using a Browser slows you down - write Unit Test for this action and use the debugger.
              – Henk Holterman
              Nov 11 at 12:52










            • it was something else i was passing IQueryable to viewer and it was why i get all dis errors , anyway thanks for help .Any() and .Contains() both working :)
              – The First
              Nov 11 at 12:55













            up vote
            1
            down vote










            up vote
            1
            down vote









            The direct answer might be



            // || s.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString) 
            || s.SerialNoInvoiceOrdrelineDeliveryCloses.Any(x => x.Contains(searchString))





            share|improve this answer












            The direct answer might be



            // || s.SerialNoInvoiceOrdrelineDeliveryCloses.Contains(searchString) 
            || s.SerialNoInvoiceOrdrelineDeliveryCloses.Any(x => x.Contains(searchString))






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 11 at 12:02









            Henk Holterman

            207k22226397




            207k22226397












            • i changed to || s.SerialNoInvoiceOrdrelineDeliveryCloses.Any(x => x.Contains(searchString)) and then browser still loading and than i get this error: System.ComponentModel.Win32Exception: The waiting action was temporarily interrupted
              – The First
              Nov 11 at 12:10










            • That sounds like a completely different problem, possibly the db.Item_Ledger_Entry subquery.
              – Henk Holterman
              Nov 11 at 12:49






            • 1




              Using a Browser slows you down - write Unit Test for this action and use the debugger.
              – Henk Holterman
              Nov 11 at 12:52










            • it was something else i was passing IQueryable to viewer and it was why i get all dis errors , anyway thanks for help .Any() and .Contains() both working :)
              – The First
              Nov 11 at 12:55


















            • i changed to || s.SerialNoInvoiceOrdrelineDeliveryCloses.Any(x => x.Contains(searchString)) and then browser still loading and than i get this error: System.ComponentModel.Win32Exception: The waiting action was temporarily interrupted
              – The First
              Nov 11 at 12:10










            • That sounds like a completely different problem, possibly the db.Item_Ledger_Entry subquery.
              – Henk Holterman
              Nov 11 at 12:49






            • 1




              Using a Browser slows you down - write Unit Test for this action and use the debugger.
              – Henk Holterman
              Nov 11 at 12:52










            • it was something else i was passing IQueryable to viewer and it was why i get all dis errors , anyway thanks for help .Any() and .Contains() both working :)
              – The First
              Nov 11 at 12:55
















            i changed to || s.SerialNoInvoiceOrdrelineDeliveryCloses.Any(x => x.Contains(searchString)) and then browser still loading and than i get this error: System.ComponentModel.Win32Exception: The waiting action was temporarily interrupted
            – The First
            Nov 11 at 12:10




            i changed to || s.SerialNoInvoiceOrdrelineDeliveryCloses.Any(x => x.Contains(searchString)) and then browser still loading and than i get this error: System.ComponentModel.Win32Exception: The waiting action was temporarily interrupted
            – The First
            Nov 11 at 12:10












            That sounds like a completely different problem, possibly the db.Item_Ledger_Entry subquery.
            – Henk Holterman
            Nov 11 at 12:49




            That sounds like a completely different problem, possibly the db.Item_Ledger_Entry subquery.
            – Henk Holterman
            Nov 11 at 12:49




            1




            1




            Using a Browser slows you down - write Unit Test for this action and use the debugger.
            – Henk Holterman
            Nov 11 at 12:52




            Using a Browser slows you down - write Unit Test for this action and use the debugger.
            – Henk Holterman
            Nov 11 at 12:52












            it was something else i was passing IQueryable to viewer and it was why i get all dis errors , anyway thanks for help .Any() and .Contains() both working :)
            – The First
            Nov 11 at 12:55




            it was something else i was passing IQueryable to viewer and it was why i get all dis errors , anyway thanks for help .Any() and .Contains() both working :)
            – The First
            Nov 11 at 12:55


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248415%2fhow-to-search-in-liststring%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Guess what letter conforming each word

            Run scheduled task as local user group (not BUILTIN)

            Port of Spain