troubleshooting Question

Populate the list if there's not match

Avatar of lulu50
lulu50Flag for United States of America asked on
.NET MVC* ASP .NET MVC 5C#
6 Comments1 Solution142 ViewsLast Modified:
Hi,

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 =

               }).ToList();



   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; }
        }
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