08 2021 档案
三级联动
摘要:在数据访问中查询表中的Id来进行返回到显示获取Id public List<Birthplace> BindList(int id) { try { return db.Birthplaces.Where(a => a.Code == id).ToList(); } catch (Exception 阅读全文
posted @ 2021-08-26 21:15 Cxy小白 阅读(54) 评论(0) 推荐(0)
Vue二级联动以及上传图片
摘要:在Dal层写 public List<TypeInfo> BindList(int cid) { try { return shopDbContext.TypeInfos.Where(a => a.Cid == cid).ToList(); } catch (Exception) { throw; 阅读全文
posted @ 2021-08-19 17:00 Cxy小白 阅读(50) 评论(0) 推荐(0)
Sql参数化添加
摘要:在Dal层写入Sql代码防止sql注入 try { //二 通过Sql语句完成添加 //二 1.防止sql注入 //二 2.SqlQuery只能执行 select 类型的语句 //以下这种写法不防Sql注入 //return db.Database.ExecuteSqlCommand($"inser 阅读全文
posted @ 2021-08-18 20:05 Cxy小白 阅读(191) 评论(0) 推荐(0)