I get "UnresolvableObjectException: Column 'lastname' not found."
Similarly, if I try to cast the result of an All() query to the following type:
public class Person
{
public int PersonnelNumber { get; set; }
public string Initials { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string KnownAs { get; set; }
}
IEnumerable<Person> result = db.dbo.person.All();
then only Initials and FirstName properties of result get mapped from the results (given what I am seeing, that FirstName should be mapped makes no sense). If I do this instead, all fields are mapped as expected:
public class PersonUnderscore
{
public int Personnel_Number { get; set; }
public string Initials { get; set; }
public string First_Name { get; set; }
public string Last_Name { get; set; }
public string Known_As { get; set; }
}
IEnumerable<PersonUnderscore> result2 = db.dbo.person.All();
I have also tried calling this first but it makes no difference:
I am working with a SQL Server db where a table is defined as:
If I try:
I get "UnresolvableObjectException: Column 'lastname' not found."
Similarly, if I try to cast the result of an All() query to the following type:
then only Initials and FirstName properties of result get mapped from the results (given what I am seeing, that FirstName should be mapped makes no sense). If I do this instead, all fields are mapped as expected:
I have also tried calling this first but it makes no difference: