I'm using Telerik ORM OpenAccess as DAL in Silverlight application and WCF RIA Services.
I have [for example] simple schema: 3 tables in database: Category, subcategory and product. Each category has some subcategories, each subcategory has some goods. So, it's simple one-to-many relationships.
I create Domain Model, after - Domain Service.
I want to load from database ALL Category Entities WITH ALL Subcategories, but WITHOUT products, because some subcategories have lot of goods. Can I use lazy-loading in my scenario? It was Question1.
Question2: The domain service doesn't generate any code for association in my Category-Subcategory. After reading this post (http://www.telerik.com/help/openaccess-orm/getting-started-root-quickstart-sl-wcfria-handle-relations.html
) I've add [Include]
attributes, after that i've seen my properties in generated code, BUT, SQL Server Profiler shows me a lot of query: "exec sp_execute 1,@p0=2", "exec sp_execute 1,@p0=3" e.t.c, like there is no Lazy-loading, it was eager Loading behaviour.
So, question is "can I use lazy-loading in WCF RIA app?"
Thank you and sorry for my english. I would appreciate a fast response.