Try to change your code as follow:
var data=MyStudentEntities.Student
.Where(x=>x.ClassID==12)
.GroupBy(x=>x.ID)
.Select(grp=>new TABLEA()
{
ID=grp.Key,
ClassID=12,
ClassName="Flower",
ClassBranch="A"
})
.ToList();
MyStudentEntities.TABLEA.AddRange(data);
MyStudentEntities.SaveChanges();