SQL Server'da bir benzer yan tümcesi nasıl yapılır?IN IN yan tümce LINQ içinde
Tek başıma yaptım ama bunu geliştirebilecek biri var mı?
public List<State> Wherein(string listofcountrycodes)
{
string[] countrycode = null;
countrycode = listofcountrycodes.Split(',');
List<State> statelist = new List<State>();
for (int i = 0; i < countrycode.Length; i++)
{
_states.AddRange(
from states in _objdatasources.StateList()
where states.CountryCode == countrycode[i].ToString()
select new State
{
StateName = states.StateName
});
}
return _states;
}
da bana yardımcı oldu, bu dize değerleri karşılaştırır, ancak ids nedir? –
@JitendraPancholi Tamsayılar için bir birleştirmeyi kullanabilirsiniz. – Eugene
@JitendraPancholi Listesini oluşturduysanız, ids için kontrol edebilirsiniz. Bu desteklenmiştir. Net 4. Daha önceki sürümlerden emin değilim. –