troubleshooting Question

Filter my data by the commitID

Avatar of lulu50
lulu50Flag for United States of America asked on
Databases.NET ProgrammingC#ASP.NET.NET MVC
6 Comments1 Solution182 ViewsLast Modified:
I have a search page that filter the commitID


If the user enter 4534565434 - > I'll get the record
if the user enter 488573377 -> I'm not getting any record

so it only get the first commitID  

my data in the database looks like this:
RuleDetailID                  CommitID
39                                       4534565434, 488573377
40                                        7876545665
41                                        678765456765
42                                       4958574757
43                                      9878787678, 39484723, 494858573
44                                      2343454345
48                                     3434433444
49                                     6756765443
51                                     6444345556, 32423443


                    //Filter CommitID
                    if (model.SelectedCommitID != null)
                    {
                        list = list.Where(x => x.CommitID != null && model.SelectedCommitID.Any(m => Array.IndexOf(x.CommitID.Split(','), m) > -1));
                    }




                    //Filter CommitID
                    if (model.SelectedCommitID != null)
                    {
                       list = list.Where(x => x.CommitID != null && model.SelectedCommitID.Any(m => Array.IndexOf(x.CommitID.Split(','), m) > -1));
                    }
ASKER CERTIFIED SOLUTION
it_saige
Developer
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros