« first day (55 days earlier)    last day (15 days later) » 

5:11 PM
Hello sir
sir I have an Agent which could have 1 or more than 1 transactions. Now I want to get all data from team members and use the agent id from Team Members to check if that
agent has any pending transactions(StatusId != 101).
var members = (from tm in _teamMemberRepository.GetAll()
                                   join tr in _transactionRepository.GetAll() on
                                   tm.AgentId equals tr.AgentId into ps
                                   from p in ps.DefaultIfEmpty()
                                   where tm.TeamId == 50
                                   select new TeamMemberDto
                                   {
                                       Id = tm.Id,
                                       CommissionPerc = tm.CommissionPerc,
 public class TeamMember
    {
        [ForeignKey("TeamId")]
        public virtual Team Team { get; set; }
        public int TeamId { get; set; }

        [ForeignKey("AgentId")]
        public Agent Agent { get; set; }
        public int AgentId { get; set; }
        public decimal? CommissionPerc { get; set; }
    }

	public class Transaction
    {
		public int AgentId { get; set; }
		public int StatusId { get; set; }
        public int AgentId { get; set; }
        [ForeignKey("AgentId")]
Problem here is since team member could have multiple transactions, this results in duplication of team members.
But What I want to do is just consider latest Transaction data for each Agent(Order by descending Id in transaction table) and then compare the latest transaction data for each agent
Can you please help me?
 

« first day (55 days earlier)    last day (15 days later) »