I read further and found a nested query case also be helpful in this can for that I was making an expression which looks with C# variables like this
var R = 6371; // km
Double dLat = (originalLatitude - searchLatitude) / (180 / Math.PI);
Double dLon = (originamLongitude - searchLongitude) / (180 / Math.PI);
Double a = Math.Sin(dLat / 2) * Math.Sin(dLat / 2) +
Math.Cos(searchLatitude / (180 / Math.PI)) * Math.Cos(originalLatitude / (180 / Math.PI)) *
Math.Sin(dLon / 2) * Math.Sin(dLon / 2);
Double c = 2 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a));
return (R * c);
I could reach upto only following state
IExpression oExpressionDLat = new Expression(oZipCodeEntity.Latitude, ExOp.Sub, ZipCodeFields.Latitude);
oExpressionDLat = new Expression(oExpressionDLat, ExOp.Div, 180 / Math.PI);
IExpression oExpressionDLon = new Expression(oZipCodeEntity.Longitude, ExOp.Sub, ZipCodeFields.Longitude);
oExpressionDLon = new Expression(oExpressionDLon, ExOp.Div, 180 / Math.PI);
My problem here is that how do I use sine, cos, and sqrt functions with the expressions