霹雳小郭

Vue的登录以及EF调用存储过程

EF调用存储过程

   1.先在数据库创建存储过程并执行

 

 

   2.再项目的数据访问层使用SqlParameter

SqlParameter[] sqls =
{
  new SqlParameter("@pageindex",pageindex),
  new SqlParameter("@pagesize",pageindex),
  new SqlParameter("@totalcount",System.Data.SqlDbType.Int),
  new SqlParameter("@totalpage",System.Data.SqlDbType.Int),
};
  sqls[2].Direction = System.Data.ParameterDirection.Output;
  sqls[3].Direction = System.Data.ParameterDirection.Output;
  var list = db.Database.SqlQuery<OrderForGoods>("exec p_Show @pageindex,@pagesize,@totalpage,@totalcount", sqls).ToList();
  totalcount = (int)sqls[2].Value;
  totalpage = (int)sqls[3].Value;
  return list;

然后由业务逻辑层以及显示层调用并且显示出完成功能

二级联动

  在Dal 数据访问层 现在叫仓储完成相关的代码

  跟上个月的二级联动是一样的具体不同的是前端

  显示的方法有所不同

 

 

posted on 2021-08-19 21:17  霹雳小郭  阅读(207)  评论(0)    收藏  举报

导航