LLBLGen and Lightswitch
-
11. května 2012 20:14
Hi,
Has anyone had any experience using LLBLGen ORM within a Lightswitch app? Either using WCF or ODATA?
Thanks,
Dave
Všechny reakce
-
11. května 2012 22:41
Hi Dave, I haven't used LLBLGen unfortunately, but it should be no problem to use in a WCF RIA service as long as it has IQueryable support for the query methods.
I looked into exposing a custom data source as a custom OData data source, using WCF data services and it did not appear that easy to do as it appeared to require a base 'Context' which I did not have. LLBLGen may well have such a context, I do not know. It also appeared more difficult to shape data in a custom OData data source, so I flagged that option in the end.
A bit off-topic, but the ability to easily shape data in a WCF RIA service is a winner for me. Incidentally the ASP.NET Web API also makes it easy to shape data from preliminary investigation.
Regards
Xander
-
14. května 2012 16:02
Hi Xander,
Thanks for replying. I usually take the EF that is generated in LS into my WCF RIA service. Then, use the WCF RIA Service in my LS app.
I'm thinking that it might be better to use the OData generated directly from LLBLGen instead of the EF. I could also augment the generated OData code with my own custom code and thus skip WCF RIA Services altogether.
If someone has done anything similar to that I would be interested to know how it worked out.
I may experement a bit with it if I have some time.
Thanks,
Dave
-
15. května 2012 4:03@Dave. I was wondering same thing. Process must be similar to creating ria service, but would like to see a post on it.
-
15. května 2012 5:28
Hi,
I've seen that OData has been supported in the next version of LightSwitch:
After reading something about LLBLGen,I've seen it have feature related to Entity Framework support
http://www.llblgen.com/Pages/featuresEntityFramework.aspx
I think maybe you can create WCF Service(Not WCF Ria Service) for your LightSwitch project.
Also, directly go to LLBLGen support maybe more helpful:
- Označen jako odpověď Otomii LuModerator 21. května 2012 3:04
-
16. května 2012 13:01
Hey Dave,
When using the LLBLGen runtime (v3.5), there's separate support for WCF data services:
Does this help?
-Wiebe
-
16. května 2012 13:13What I am talking about is not consuming the primary OData object context, which works fine. It is creating a custom object context based on the primary (or other data objects) and having another *.svc point. Like you can with RIA library, but instead with OData. So that you can shape the data like in Eric's first RIA GroupBy/Reporting post. I could create a seperate OData project and *.svc file, but could not get the append the URL and get it to show data. Not sure what I was missing.
-
16. května 2012 15:22
@Wiebe: Yes, that does help as it points out some of the limitations.
It appears as though no one has any experience specifically with llblgen. So, time allowing, I'll be testing it out.
Thanks,
Dave
-
20. května 2012 21:38
Once again a bit off-topic, but I may have to change my comment above about it not being easy to create a custom OData source and shape your data. I discovered the following article that illustrates how to create a custom OData data source as easy as it is to create a custom RIA data source where you can easily shape your data:
http://blogs.msdn.com/b/dineshsabnani/archive/2012/05/18/wcf-data-service.aspx
I am going to try this when I have a moment.
Xander
-
20. května 2012 21:41
Once again a bit off-topic, but I may have to change my comment above about it not being easy to create a custom OData source and shape your data. I discovered the following article that illustrates how to create a custom OData data source as easy as it is to create a custom RIA data source where you can easily shape your data:
http://blogs.msdn.com/b/dineshsabnani/archive/2012/05/18/wcf-data-service.aspx
I am going to try this when I have a moment.
Xander
Also see:
Shape Your LightSwitch OData Using WCF RIA Services
-
21. května 2012 0:09
Thanks for reminding me about your excellent article, I have seen it previously but it is good to read it again for a refresher. Actually ties in nicely with my other post in the LS2 beta forum about shaping data: http://social.msdn.microsoft.com/Forums/en-US/LightSwitchDev11Beta/thread/687186f9-7b96-4fb8-914f-295bfe3ceb66
Xander
- Upravený novascape 21. května 2012 0:10
-
21. května 2012 0:14
Thanks for reminding me about your excellent article, I have seen it previously but it is good to read it again for a refresher. Actually ties in nicely with my other post in the LS2 beta forum about shaping data: http://social.msdn.microsoft.com/Forums/en-US/LightSwitchDev11Beta/thread/687186f9-7b96-4fb8-914f-295bfe3ceb66
Xander
Once you have the WCF RIA service wired-up to consume the internal LightSwitch databse, I have found that it takes only a few minutes to create a new entity.
Basically the syntax is exactly what I would use in my normal LightSwitch code behind.
So the thing that would be helpful from the LightSwitch team would be a wizard that created the WCF RIA service for us :)