You have more than one option.
Option #1: Grouping, and returning a resultset.
var q = from od in metaData.OrderDetail
where od.ProductId == 1
group od by od.ProductId into g
select new
{
MaxQuantity = g.Max(x => x.Quantity)
};
var result = q.ToList();
Option #2: ScalarQuery
var q = from od in metaData.OrderDetail
where od.ProductId == 1
select od;
var result = q.Max(x=>x.Quantity);
Option #3: ScalarQuery, in the simplest form
var q = from od in metaData.OrderDetail
where od.ProductId == 1
select od.Quantity;
var result = q.Max();