Ramco Ramco

Ramco Ramco

  • 439
  • 3.4k
  • 545.5k

Error-Cannot implicitly convert anonymous type generic list

Sep 11 2022 5:52 AM

HI

 Cannot implicitly convert anonymous type generic list to TrainingNominee Generic list.

public List<TrainingNominee> GetSelectedNominees(Int32 TrainingId, Int32 ParticipantId)
        {
            try
            {
                List<TrainingNominee> Result = (from t in context.TrainingNominees.Where(k => k.TrainingID == TrainingId && k.ParticipantID == ParticipantId)
                                                join Nominee in context.View_Nominees on t.NomineeId equals Nominee.Id
                                                select t).ToList();
                return Result;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

Thanks


Answers (2)