Похожие чаты

In one table i have two columns one is unique

and another is duplicate.
unique always unique and duplicate is that maybe has duplicate and may be not. now i want get Duplicate value of some column that is equals unique and then use that to get all value that has same value as duplicate. (i don't understand what i wrote so i will show an example).i can get what i want with two step i want to is that possible to get that in one step
public class Test
{
public string Unique {get; set;} //sample data: one, two, three, four,
public string Duplicate {get; set;} //same data: yes, yes, no,yes
}

//step one get result of unique that equals one
// step two get result of all record that equals yes (because one has yes as duplicate value)
var test = db.Tests.First(t=> t.Unique == "one");
var otherTests = db.Tests.Where(tt => tt.Duplicate == test.duplicate).ToList();
// i want those two queries become one is that possible?

2 ответов

17 просмотров

you could use .Join()

Mr-Thieves Автор вопроса
luca flan di vedure
you could use .Join()

both result are in same table. so i should write something like this? var tests = db.Tests.First(t => t.Unqiue == "one).Join( // i don't know what do here)

Похожие вопросы

Обсуждают сегодня

For managing user-generated content rights in gaming? 🤯🚀
Brian
37
@Aiwan что такое база образца?
Alexey
27
Не многие знают, а кто знает, тот уже успел забыть, что в далёком 2004 году эта игра произвела настоящий фурор, настолько революционной была технология, применяемая для её соз...
ICCID
4
Короче я тут узнал полный пиздец Что кучу постов которые я создавал через posted Спустя время не могу редактировать и менять Мол телега возвращае ошибку Это реально так ...
inc.
13
Hi is Atomic wallet safe to exchange btc to xmr?
Regex
19
I have LUSD tokens but they haven't pegged back to a dollar. Is there a reason why?
Harry the Hexican
14
коллеги, добрый вечер! А никто не знает как модальная форма может себя закрыть? Ну допустим модальная форма определила, что смысла ей работать нет и хочет вернуть modalResult...
Михаил
83
Хотя у меня сейчас есть более сложная задача, вот её думаю: как объяснить челу переходного возраста противоположного полу, обучающегося в польском колледже (а-ля наш техникум)...
Вячеслав Кузьменко
15
Is UniBright Freequity an active live product ? A friend here in Asia was discussing the Tokenisation of RWA’s in his case Real Estate as he’s a developer with numerous overs...
Digital Trust
4
Hello, Ergo Investor here. Had a few questions for the leadership of the project, from what I’ve seen @kushti_ru , @Armeanio @dadreboi In one sentence, what is your vision f...
A
10
Карта сайта