I have this Azure Model called Matches where I have OrderId
and MatchedOrderId
like this
public String OrderId
{
get
{
return this.PartitionKey;
}
set
{
this.PartitionKey = value;
}
}
public String MatchedOrderId
{
get
{
return this.RowKey;
}
set
{
this.RowKey = value;
}
}
So when I have two orders and they match I make two entries in this table. Making two entries is so that I can charge Organizations on the number of matches they have.
Now I want to display the number of matches, what I have been doing before is Getting all the matches in this Model like this
public static IEnumerable<Match> GetAll()
{
return TableHelper.GetAll<Match>();
}
But now I want to show the actual matches. So what I want to show is just one entry for the two entries I created. After getting all the matches like this
List<Match> matches = Matches.GetAll();
Is there a Linq query that can give me what I want?
It is not the duplicate of what has mentioned, because in that the records are identical but here the Entries are different. So an example is,
Entry 1:
OrderId: "xyz"
MatchedOrderId: "abc"
Entry 2:
OrderId: "abc"
MatchedOrderId: "xyz"
If I do simple Distinct it won't work.