Ramco Ramco

Ramco Ramco

  • 445
  • 3.4k
  • 530.5k

Error-Cannot implicitly convert type System.collection.generic.list

Apr 5 2023 10:50 AM

Hi

 I am getting below error - Cannot implicitly convert type System.collection.generic.list <LMS.DAL.StudentBreak> to System.collection.generic.list <lms.mentoradmin.studentbreak>

BALStudents bALStudents = new BALStudents();
List<StudentBreak> Result = bALStudents.GetStudentBreakList();

namespace LMS.BAL
{
    public class BALStudents
    {
        public List<StudentBreak> GetStudentBreakList()
        {
            List<StudentBreak> Result = (from t in context.StudentBreaks
                                          where t.Active == true
                                          orderby t.Name
                                          select t).ToList();
            return Result;
        }
    }
}

Thanks


Answers (2)