I have a linq query by which I wanted to fetch single record on the basis of below criteria-
- Select column_A (int), column_B (string)
- Select max value row on the basis of Column_A
I tried with this query-
var result = this.context.Table1
.Where(x => x.Id == SomeId)
.Select(s => new {
s.column_A,
s.column_B })
.Max(item => item.column_A);
But I am not sure it's a valid query or not. Can somebody let me know correct way to do this. Also after this query I wanted to get those two fields value like below-
var sequence = result.column_A
var index = result.column_B