HI Team
I have a method and trying to access every single value, somehow i think i am missing something and yet im not getting them according what im assigning. See my logic below;
// private Application_CheckList _context;
public List DashboardTimeLine()
{
// List timeList = new List();
var dashboardList = _context.Resources.Select(x => new Dashboard()
{
FromDateTime = x.// i dont get FromDatetime only gets and setters
}).ToList();
return dashboardList;
}
// Model.cs
public class Dashboard
{
public int Incident { get; set; }
public DateTime FromDateTime { get; set; }
public DateTime ToDate { get; set; }
public DateTime Start_Date { get; set; }
public string Description { get; set; }
public DateTime EndDate { get; set; }
}
Sachin SinghPosted Sep 28, 2021, 6:55 AM
If your domain is Dashboard then your DbSet name will be Dashboards (plural)
You are using Resources as the DbSet, that doesn't contain the property FromDateTime.
Open your Application_CheckList class, which is DbContext and under that find the DbSet you are interested in and then use the same logic you have used above.