为什么我这样写会报致命错误 ? 返回

求助
1 94
 return await TaskHelper.AsyncExecutionRezult(() =>
            {
                try
                {
                    using (SqlSugarClient DbObj = db.GetInstance(DB.db_core.GetAttributeValue()))
                    {
                        var query = DbObj.Queryable<tb_readonly_invoice_data>()

                            .WhereIF(inModel.MatnrList.IsAny(), p => p.MATNR, inModel.MatnrList)

                            .WhereIF(inModel.WerksList.IsAny(), p => p.WERKS, inModel.WerksList)

                            .WhereIF(inModel.FkdatStart != null, p => p.FKDAT >= inModel.FkdatStart)

                            .WhereIF(inModel.SalesGroup.IsNotNullOrEmpty(), p => p.VKGRP == inModel.SalesGroup)

                            ;

                        //string inStringSql = "";

                        //if (inModel.FkdatStart != null)
                        //{
                        //    inStringSql += " force index(idx_FKDAT) ";
                        //}

                        //string sqlResult = query.ToSql().Key.Insert(query.ToSql().Key.IndexOf("WHERE 1=1"),
                        //    inStringSql);

                        return DbObj.SqlQuery<tb_readonly_invoice_data>(query.ToSql().Key, query.ToSql().Value);
                    }
                }
                catch (Exception ex)
                {
                    log.Errorlog("E", Name, MethodBase.GetCurrentMethod().Name, ex.ToString());
                    return null;
                }
            });

image.png

但是我十分确认,我确实已经定义了这个参数 .

image.png

热忱回答1

  • 有没有用办法吧String转换为 new{a:1,b:b} 这种形式 ? 

    0 回复

版块

学习文档

最新会员

发布达人

回贴达人