Exemplo n.º 1
0
        public IList <Allstd> GetAllStudents()
        {
            List <Allstd> StudentList = new List <Allstd>();

            using (StudentsEntities context = new StudentsEntities())
            {
                var result = context.StudentRecord().ToList();

                foreach (var item in result.ToList())
                {
                    StudentList.Add(new Allstd
                    {
                        StudentId  = item.StudentId,
                        Name       = item.FirstName,
                        LastName   = item.LastName,
                        EmailId    = item.EmailId,
                        PhoneNo    = item.PhoneNo,
                        ImgProfile = item.ProfilePic
                    });
                }
                return(StudentList);
            }
        }