I have this query:
Select MAX(CAST(value As int)) from tableName
I want to get the max value of a column using entity formwork and put it on the corner of my website.
I have this query:
Select MAX(CAST(value As int)) from tableName
I want to get the max value of a column using entity formwork and put it on the corner of my website.
You are looking for the Max()
method. Also use lambda expressions:
var max = context.TableName.Max(i => i.ColumnName);
(Where ColumnName is the column what you aggregate on.)