Try this, I hope it can be a simple way.
public object DoCalculate(string expression)
{
object result = null;
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Val",typeof(object),expression));
foreach (DataRow item in dt.Rows)
{
result= item["val"];
}
return result;
}
you can cast the result accordingly.