IConditionalModel求助 返回

求助
119
该叫什么   发布于2周前
悬赏:5 飞吻

    List<IConditionalModel> conModels = new List<IConditionalModel>();

            if (categoryList != null)

            {

                ConditionalCollections coll = new ConditionalCollections();

                List<KeyValuePair<WhereType, ConditionalModel>> ConditionalList = new List<KeyValuePair<WhereType, ConditionalModel>>();

                coll.ConditionalList = ConditionalList;

                foreach (long item in categoryList)

                {

                    KeyValuePair<WhereType, ConditionalModel> keypair = new KeyValuePair<WhereType, ConditionalModel>

    (WhereType.And,

    new ConditionalModel() { FieldName = "pro.CategoryId", ConditionalType = ConditionalType.Equal, FieldValue = item.ToString() });

                    coll.ConditionalList.Add(keypair);

                }

                conModels.Add(coll);

            }


生成的sql出现两个and

 AND ( [pro].[IsDel] = @IsDel6 ))  AND  AND (   pro.CategoryId = @Conditionalpro_CategoryId1000   )

如何处理

热忱回答0

版块

学习文档

最新会员

发布达人

回贴达人