question

MansoorMohammed-9831 avatar image
0 Votes"
MansoorMohammed-9831 asked JackJJun-MSFT commented

Entity Framework Query


Serial Number CHECK_NUMBER CHECK_VERSION ROUTING_NUMBER TRANSACTION_SEQUENCE
1 09172113334652298482 New 615114379 1
2 03346522984829172113 New 679151143 2
3 02113391784823465229 New 619511437 3
4 09172113334652298482 Old 615114379 2
5 03346522984829172113 Old 679151143 3
6 02113391784823465229 Old 619511437 4

For My Entity FrameWork, in the For Loop

{
While working with serial number 4 5 and 6
I should get the previous Tansaction(Transaction Sequence - 1) row
Ex: for SerialNumber 4, the previuos transaction is 1, same way for 5 its 2 and for 6 its 3

I tried below, but it did NOT work
var previousTransactions = transactions
.Where(pt => pt.Check_Number == t. Check_Number
//&& pt.Check_Version == t. pt.Check_Version
&& pt.Transaction_Sequence == Transaction_Sequence).FirstOrDefault();
//.OrderByDescending(pt => pt.Sequence_Number).FirstOrDefault());
.Distinct(new TransactionComparer());

}

dotnet-entity-framework
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MansoorMohammed-9831, Could you describe your question more clearly? For example, at the beginning of the question, you could do it like the following if you want to show a table. Also, Please provide the completed code to let me analyze your problem.
140541-image.png


1 Vote 1 ·
image.png (3.1 KiB)

0 Answers