Похожие чаты

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 ответов

31 просмотр

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)

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

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

Hey everyone! I won’t focus too much on what this person said (it’s clear they don’t understand the scope of what TF and TELOSX are achieving), but I’ll put it simply for thos...
Ana Ojeda
3
Hi did any of you experience a file error when download hex file for Windows?
Valya
17
как правильно удалить сддм? прописал в etc/portage.use/plasma-meta -sddm , но при обновлении юзов мне предлагает поставить lightdm (ещё лучше 😡), добавил туда - display-manage...
REDis
25
Всем привет! Имеется функция: function IsValidChar(ch: UTF8Char): Boolean; var i: Integer; ValidChars: AnsiString; begin ValidChars := 'abcdefghijklmnopqrstuvwxyzABCDE...
Евгений
44
Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
Also, scrolling at the history here, I see there was alot of hate towards kaspa.. is it still the case after they proved the history of the chain?
Gad Levy | AnyLog
11
Please I want to ask if my stake is 24% complete, what penalty will I pay if I end the stake?
Crypto Advocate
12
Коллеги, я тут для личных нужд пошел ставить MQTT сервер, пощупал mosquitto, но ужаснулся отсутствию такой банальности, как HTTP API для посмотреть список топиков. А тут что,...
Maksim Lapshin
14
Could the new Norse labs apps have just been called "VPN" instead of DVPN?
HDGVII
14
How will they work it out?
Max
14
Карта сайта