1. 创建实体类 -> 使用 ef Power Tool
2. 创建连接 -> 查询数据 -> 操作
using (TestContext context = new TestContext())
{
foreach (Model m in context.Models) // 使用ToList转换成集合,用于修改
{
// Do Something
}
context.SaveChanges(); // 同步到数据库
}
时间: 2024-08-04 19:23:19
1. 创建实体类 -> 使用 ef Power Tool
2. 创建连接 -> 查询数据 -> 操作
using (TestContext context = new TestContext())
{
foreach (Model m in context.Models) // 使用ToList转换成集合,用于修改
{
// Do Something
}
context.SaveChanges(); // 同步到数据库
}