I am trying to call GetScanningLogOnSettings()
, which queries the ScanningDepartments
table to get the departments, then creates an instance of ApplicationLogOnModel
, assigns the queried results to a variable within the ApplicationLogOnModel
, and returns the result.
private ApplicationLogOnModel GetScanningLogOnSettings()
{
var mesEntity = new MESEntities();
var departments = from dept in mesEntity.ScanningDepartments
select dept.Department.ToList();
ApplicationLogOnModel depts = new ApplicationLogOnModel()
{
Department = departments
};
return depts;
}
It gives me:
"Cannot implicitly convert type
'System.Linq.IQueryable<System.Collections.Generic.List<char>>
to'System.Collections.Generic.List<Models.Department>'
Tried converting to lists and am having a little trouble.