visual studio lightswitch - Lighswitch wcf ria service with EF 6 -


good day!

i create wcf ria service described in this example, example work ef 6.1 , getallorders method return collection database.

public class riaservice : domainservice {     [query(isdefault = true)]     public iqueryable<rb17> getallorders()     {          var model = new model1();         return model.orders;     }      protected override int count<t>(iqueryable<t> query)     {         return query.count();     } } 

after, create lightswitch project, add datasource wcf ria service , add screen.
when run project, list screen return error:
"unable load data. please check network connection , try loading again.".

please explain me, must initialize connection? on wcf ria service in method gelallorders, works fine, method return collection queryable when set break point. in class model1 added connectionstring. why ls request connection?

just checking couple of things:

  1. does model1 class return iqueryable<rb17>?
  2. also rb17 class have unique id property (with key attribute) populated each record?

without unique id property, lightswitch will have problems entity, doesn't result in error mention. however, error can caused many different things, can extremely difficult track down.

the fact you're using ef 6.1 shouldn't problem. doesn't matter lightswitch how create entities, long satisfy 2 rules mentioned above. database connectivity common cause of error, when debug can see records being created?


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -