LINQ and C #: how to add a field and not mapped to a table column
I am loading records from a database table. I need to add a field called "temp" that doesn't match any columns in the table. How do I add this field?
namespace mynamespace.Models
{
public class alert
{
[Key]
public int id { get; set; }
public string text { get; set; }
public string temp { get; set; } //<--- this generates error
}
}
Thank you and welcome.
+3
source to share