EF 连接mySql 踩坑历程。看了很多文件,就这个帮了我。
https://blog.csdn.net/qq_43542583/article/details/104759114?spm=1001.2014.3001.5501
迁移 Add-Migration Initial
Add-Migration Initial
update-database -verbose
Add-Migration daogaoBiaoxiugai
实现批量修改
/// <summary> /// 修改产品 /// </summary> /// <param name="productdto"></param> public void UpdateProduct(ProductDto productdto) { var product = _context.Products.Include(a => a.ProductConfig).Any(p => p.Id == productdto.Id); if (!product) throw new Exception("传入的ID未找到产品"); var upDateproduct = _mapper.Map<Product>(productdto); _context.Products.Update(upDateproduct); _context.SaveChanges(); }
Linq常用查询运算符
https://www.cnblogs.com/powerdk/p/5093455.html
.net core EF Core 视图的应用
https://www.cnblogs.com/Vam8023/p/10789131.html
微软官方文档 Entity Framework Core
https://docs.microsoft.com/zh-cn/ef/core/
https://www.cnblogs.com/pangjianxin/p/10785615.html
微软官方文档没事多看看
https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/?view=aspnetcore-3.1&tabs=windows