how to print not mapped value
- by IcanMakeIt
I am using complicated SQL queries, i have to use SqlQuery ... in simple way:
MODEL:
public class C
{
public int ID { get; set; }
[NotMapped]
public float Value { get; set; }
}
CONTROLLER:
IEnumerable<C> results = db.C.SqlQuery(@"SELECT ID, ATAN(-45.01) as Value from C);
return View(results.ToList());
VIEW:
@model IEnumerable<C>
@foreach (var item in Model) {
@Html.DisplayFor(modelItem => item.Value)
}
and the result for item.Value is NULL.
So my question is , how can i print the computed value from SQL Query ?
Thank you for help.