//创建上下文选择器
adminEntities1 admin = new adminEntities1();
//查询condition表中数据
var index = from count in admin.condition
select count;
List<Conditions> list = new List<Conditions>();
Conditions add;
foreach (var item in index)
{
add = new Conditions();
add.Id = item.id;
add.Name = item.name;
add.Age = (int)item.age;
add.Address = item.address;
add.Height = (double)item.height;
add.Weight = (double)item.weight;
add.Marriage = item.marriage;
list.Add(add);
}
把list集合中的数据添加到ES索引中