在linq中用字母ی替换字母ي?

时间:2012-05-19 09:06:35

标签: asp.net linq linq-to-entities linq-to-objects

我想将بازي替换为بازی

var List = (from darkhast in Tbl_Darkhast.Where(d => d.Address.Replace("ی","ي").StartsWith( Address.Replace("ی","ي")  ) )
                select new
                {
                  ....
                }

3 个答案:

答案 0 :(得分:2)

我认为,你应该写入选择查询

 var List = (from darkhast in Tbl_Darkhast) )
                select new Tbl_Darkhast
                          {
                             Address= darkhast.Address.Replace("ی","ي")
                             ,Name = darkhast.Name
                          };

答案 1 :(得分:0)

距离和角色位移:

var List = (from darkhast in Tbl_Darkhast.Where(d => d.Address.Replace(" ", "").Replace("ي", "ی").Replace("ك", "ک").StartsWith(Address.Replace(" ", "").Replace("ي", "ی").Replace("ك", "ک")))
select new
{
    ....strong text
}

答案 2 :(得分:0)

结果是=>

var List =(来自Tbl_Darkhast.Where中的darkhast(d => d.Name_Moteghazi.Replace(“”,“”)。更换(“ي”,“ی”)。替换(“ك”,“ک “).StartsWith(NameMoteghazi.Replace(”“,”“)。Replace(”ي“,”ی“)。替换(”ك“,”ک“)))

                select new
                {
                    Shomare_Darkhast = darkhast.Shomare_Darkhast,
                    Tarikhe_Darkhast = darkhast.Tarikhe_Darkhast,
                    Sharhe_NoeDarkhast = darkhast.TBL_NoeDarkhast.Sharhe_NoeDarkhast,
                    Mantaghe = darkhast.Mantaghe,
                    Hoze = darkhast.Hoze,
                    Block = darkhast.Block,
                    Melk = darkhast.Melk,


                });
    return (ObjectQuery)List;