We help IT Professionals succeed at work.
Get Started

Populate the list if there's not match

lulu50 asked
Last Modified: 2020-03-01

my syntax is wrong

I need your help please

  public List<MissedCommitID> MissedCommitIDList(CABRManagement model)
            List<MissedCommitID> MissedCommitIDList = new List<MissedCommitID>();

          // Here I want to check if MigrationCommitID  matches CommitID then populate the list MissedCommitIDList 

          // MigrationCommitID and CommitID fields are stored in the model.RuleDetailList

          //if both fields do not have the same data then populate the new list. "MissedCommitIDList "

 var MissedCommitID = _unitOfWorkCABusinessRules.RuleDetailRepo.Where(x => x.RuleDetailId == model.RuleDetailList.Where(m => m.RuleDetailID == x.RuleDetailId));

 MissedCommitIDList = MissedCommitIDList.ToList().Select(x => new MissedCommitID
                CQticket = model.RuleDetailList.Select(x => x.CQTicket);
                UserName =
                Version =
                Environment =
                commitID =


Open in new window

   public List<RuleDetailMgm> RuleDetailList { get; set; }

        public class RuleDetailMgm
            public int RuleDetailID { get; set; }
            public string CQTicket { get; set; }
            public string Environments { get; set; }
            public string Versions { get; set; }
            public string RuleSet { get; set; }
            public string RuleIdentifier { get; set; }
            public string CommitID { get; set; }
            public string MigrationCommitID { get; set; }
            public string SubmitterLastNameFirstName { get; set; }
            public DateTime MigrationDate { get; set; }
            public DateTime CreatedDate { get; set; }
            public int CountOfAttachedDocuments { get; set; }

RuleDetailRepo table fields

RuleDetailId	int	Unchecked
isActive	bit	Checked
RuleSetId	int	Unchecked
RuleIdentifierId	int	Unchecked
Version	varchar(50)	Unchecked
Environment	varchar(50)	Unchecked
CQTicket	varchar(250)	Unchecked
CommitID	varchar(1000)	Checked
MigrationCommitID	varchar(1000)	Checked

 public List<MissedCommitID> MissedCommitIDList { get; set; }

        public class MissedCommitID
            public string CQticket { get; set; }
            public string UserName { get; set; }
            public string Version { get; set; }
            public string Environment { get; set; }
            public string commitID { get; set;  }
            public string MigrationCommitID { get; set; }

Open in new window

Watch Question
Distinguished Expert 2019
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE