This question is locked. New answers and comments are not allowed.
Hi, i've wrote some classes and successfully created a db with that. The problem is the query with a LINQ expression. When i use scope.Extend<Person>().First(x => x.Lastname=="Test") it works, but tells me that this is an obsolete. This uses a client-side methode to query the results. So i changed my code to scope.Extend<Person>().Where(x => x.Lastname=="Test").First(). Here is the problem. The exception message is "Identifier 'Lastname' is not a parameter or variable or field of 'OpenAccessTest.Leiter'. If 'Lastname' is a property please add the FieldAlias attribute to it. So i added the attribute to the property but nothing changed. I think that this attribute is for reverse mapping.
Is it possible to query my objects in the database and not in the application memory? Could anyone get me an example?
Thanks,
Andreas
Is it possible to query my objects in the database and not in the application memory? Could anyone get me an example?
using Telerik.OpenAccess; |
namespace OpenAccessTest |
{ |
[Persistent(IdentityField = "_identNummer")] |
public class Person |
{ |
private int _identNummer; |
public int IdentNummer |
{ |
get |
{ |
return _identNummer; |
} |
set |
{ |
_identNummer = value; |
} |
} |
private string _firstName; |
public string Vorname |
{ |
get |
{ |
return _firstName; |
} |
set |
{ |
_firstName = value; |
} |
} |
private string _lastName; |
public string LastName |
{ |
get |
{ |
return _lastName; |
} |
set |
{ |
_lastName = value; |
} |
} |
private string _address; |
public string Address |
{ |
get |
{ |
return _address; |
} |
set |
{ |
_address = value; |
} |
} |
} |
} |
Thanks,
Andreas