0

I have a strange scenerio. RIA services is working for all of my entities except for one.

With this one entity, if the URL passed to the svc is standard, it works. If it has a take parameter, it does not work.

Example URLS

http://mysite/ClientBin/Myclass.svc/binar/GetEntity1  //(works)
http://mysite/ClientBin/Myclass.svc/binar/GetEntity1?$take=20  //(does not work)

It is only this single entity that I have this problem with. None of the others have this problem.

Any ideas?

EDIT: I fixed it by disabling my query scrubber and using a cached list of entites. I use a scrubbing class to tidy up the queries so LINQ to nHibernate can handle the queries, but I only do that for a few types. Still, it works fine for the other entities, but not this one.

mCasamento
  • 1,413
  • 1
  • 11
  • 21
Bytemaster
  • 166
  • 7
  • What exception are you getting ? Also, are, in your query using Fetch ? Starting With Nh 3.1 the need to "scrub" (i.e. reordering linq call) is dramatically reduced, what kind of "scrub" are you doing ? – mCasamento Sep 19 '12 at 07:17
  • I was having difficulties in trapping the error at the point it was being executed, so I was only getting a generic exception. The scrubbing is replacing the .CompareTo operator in the query that RIA generates with a normal comparison that nHibernate LINQ can handle. Example: Item.CompareTo(25)>0 turns into Item > 25. – Bytemaster Sep 27 '12 at 17:46
  • Ok If in the IQueryable that GetEntity1 returns ther's a fetch/fetchmany, can you try removing it ? Otherwise post a sample of what your method return, linqtonhibernate it's a bit picky about order of methods – mCasamento Sep 27 '12 at 19:33

0 Answers0