Well, I don't know anything about the Klient ctor (and I can't see a
Full code of Klient class. Constructor has 52 parameters.
[Table(Name = "Klient")]
public class Klient : Entity.Klient {
public Klient() : base() { }
public Klient( System.String p_kood, System.String regnr,
System.String vatpayno, System.String piirkond,
System.String postiindek, System.String tanav,
System.String kontaktisi, System.String telefon,
System.String faks, System.String email, System.String infomail,
System.String wwwpage, System.String liik, System.String viitenr,
System.String riik, System.String riik2, System.String riigikood,
System.String hinnak, System.String erihinnak,
System.String myygikood, System.String objekt2,
System.String objekt5, System.String objekt7,
System.String maksetin, System.String omakseti,
System.Decimal krediit, System.Decimal ostukredii,
System.String masin, System.String info, System.String maksja,
System.Decimal elanikud, System.Decimal pindala,
System.String grmaja, System.Decimal apindala,
System.Decimal kpindala, System.String idmakett,
System.String tulemus, System.String omandisuhe,
System.String username, System.String changedby,
System.String parool, System.String hinnaale,
System.Boolean mitteakt, System.DateTime? kontakteer,
System.String klikaart, System.String kaibegrupp,
System.Decimal mhprotsent, System.String aadress,
System.String timestamp, System.String atimestamp,
System.String kood, System.String nimi
) :
base(p_kood, regnr, vatpayno, piirkond, postiindek, tanav, kontaktisi,
telefon, faks, email, infomail, wwwpage, liik, viitenr, riik, riik2,
riigikood, hinnak, erihinnak, myygikood, objekt2, objekt5, objekt7,
maksetin, omakseti, krediit, ostukredii, masin, info, maksja, elanikud,
pindala, grmaja, apindala, kpindala, idmakett, tulemus, omandisuhe,
username, changedby, parool, hinnaale, mitteakt, kontakteer, klikaart,
kaibegrupp, mhprotsent, aadress, timestamp, atimestamp, kood, nimi) {
}}
I'm very surprised that the
"orderby" makes a difference here... it might be useful to compare/
contrast the SQL with/without the order by? (my previous code shows
how). Perhaps post this?
sql statement generated in same in both cases:
SELECT x$.p_kood, x$.regnr, x$.vatpayno, x$.piirkond, x$.postiindek,
x$.tanav, x$.kontaktisi, x$.telefon, x$.faks, x$.email, x$.infomail,
x$.wwwpage, x$.liik, x$.viitenr, x$.riik, x$.riik2, x$.riigikood, x$.hinnak,
x$.erihinnak, x$.myygikood, x$.objekt2, x$.objekt5, x$.objekt7, x$.maksetin,
x$.omakseti, x$.krediit, x$.ostukredii, x$.masin, x$.info, x$.maksja,
x$.elanikud, x$.pindala, x$.grmaja, x$.apindala, x$.kpindala, x$.idmakett,
x$.tulemus, x$.omandisuhe, x$.username, x$.changedby, x$.parool,
x$.hinnaale, x$.mitteakt, x$.kontakteer, x$.klikaart, x$.kaibegrupp,
x$.mhprotsent, x$.aadress, x$.timestamp, x$.atimestamp, x$.kood, x$.nimi
FROM klient x$
exception seems to occur before database access.
For reference, I did some refactoring, which now
a: allows simple use from IQueryable<T> (extension method)
b: uses the correct type internally (rather than IComparable), just in
case there are some optimisations done internally
Thank you.
I switched to this code but it has the same issue.
Andrus.