Guest User

Guest User

  • Tech Writer
  • 2.1k
  • 473.3k

How to use Entity framework get record list on your database?

Sep 28 2021 6:02 AM

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<Dashboard> DashboardTimeLine()
{
    // List<Dashboard> timeList = new List<Dashboard>();
    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; }
}

Answers (1)