AiNoTame

Dio è nella pioggia.
posts - 17, comments - 79, trackbacks - 0

[LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

LightSwitch permette di creare/gestire un database al suo interno senza utilizzare strumenti esterni. Questo DB è chiamato ApplicationData e verrà generato in produzione, in fase di deploy, utilizzando una connection string impostata tramite widzard.

Cosa avviene in pratica:

 - La connessione viene memorizzata, sempre con lo stesso nome "_IntrinsicData", all'interno del web.config deployato.
 - l'ObjectContext di EF viene autogenerato nel file ServerGenerated\GeneratedArtifacts\ApplicationData.cs

Per utilizzare l'ObjectContext in un WCF Ria Service quindi basta:
 - Aggiungere il file al progetto WCF Service (As Link dato che verrà rigenerato)
 - Recuperare l'ObjectContext nel seguente modo:

EntityConnectionStringBuilder builder = new EntityConnectionStringBuilder();
builder.Metadata =
"res://*/ApplicationData.csdl|res://*/ApplicationData.ssdl|res://*/ApplicationData.msl";
builder.Provider = "System.Data.SqlClient";
builder.ProviderConnectionString =
WebConfigurationManager.ConnectionStrings["_IntrinsicData"].ConnectionString;
var context = new ApplicationDataObjectContext(builder.ConnectionString);


In questo modo è possibile:
 - eseguire query complesse sul nostro db applicativo (quelle supportate dal provider di EF)
 - sopperire alle "mancanze espressive" delle query linq generate in LightSwitch e poter utilizzare entità custom definite nella nostra libreria (per esempio a fine reportistici)

Print | posted on mercoledì 30 novembre 2011 01:20 | Filed Under [ LightSwitch EntityFramework WCF ]

Feedback

Gravatar

# bunny

Now a days any kind of information is helpful for me and really like this website due to this information you shared.
30/06/2015 21:14 | cost effective seo
Gravatar

# re: [LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

Hey your collection is outstanding; I never see such a type of collection before. Thanks for sharing it with us. Keep it up.
boynton beach orthodontist
30/06/2015 22:31 | AVIS
Gravatar

# re: [LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

The positive comments and do well wishes are very motivational and greatly appreciated.
30/06/2015 23:05 | sales strategy
Gravatar

# re: [LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

I will definitely be visiting again!
30/06/2015 23:20 | sales consultancy
Gravatar

# re: [LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

Hey, its an amazing information dude. Thanks for sharing this great.
royal palm beach orthodontist
30/06/2015 23:22 | AVIS
Gravatar

# re: [LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

I am so glad this internet thing works and your Information really helped me. Might take you up on that home advice you.
buy percocet online
01/07/2015 02:16 | AVIS
Gravatar

# re: [LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

I am still learning from you, but I am trying to achieve my goals. I certainly enjoy reading all that is posted on your blog. Keeps the information coming. I loved it
buy hydrocodone online
01/07/2015 02:45 | AVIS
Gravatar

# re: [LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

I am very happy to get this post and comment here.
buy adderall online
01/07/2015 03:55 | AVIS
Gravatar

# Medicine Information

Hello Dear, Really your blog is very interesting.... it contains great and unique information. I enjoyed to visiting your blog. It's just amazing.... Thanks very much.
Buy Ritalin Online
22/01/2016 21:48 | Sam Ross
Gravatar

# Medicine Information

Really this is the exactly information I m looking for and you help me a lot. Thanks for your help.
Buy Adderall Online
22/01/2016 22:50 | Sam Ross
Gravatar

# re: [LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

Amazing! Finally I got a web journal from where I have the capacity to truth be told get supportive information in regards to my study and learning.
Hikvision UK
24/02/2016 19:25 | Furiosa
Gravatar

# re: [LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

Its great talk with respect to this passage here at this site page, I have read all that, so as of now me additionally remarking at this spot.
Hikvision CCTV Kit
24/02/2016 22:21 | Furiosa
Gravatar

# re: [LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

This sort of message continually motivating and I like to peruse quality substance, so cheerful to discover great spot to numerous here in the post the written work is simply incredible, thanks for the post.
Hikvision NVR
24/02/2016 22:28 | Furiosa
Gravatar

# re: [LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

Great post, I realize something harder on unmistakable online journals regular.
Hikvision DVR
24/02/2016 22:28 | Furiosa
Gravatar

# re: [LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

This one helped me for a theory which I am composing. Much thanks to you for giving me another perspective on this troublesome circumstance. Presently I can undoubtedly finish my article. Much appreciated.
Hikvision Turbo HD DVR
24/02/2016 22:29 | Furiosa
Gravatar

# re: [LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

I really enjoyed reading this post, big fan. Keep up the good work andplease tell me when can you publish more articles or where can I read more on the subject?
tribratanewspolresrohil.com
19/07/2017 12:09 | hop over to this website
Gravatar

# re: [LightSwitch] Utilizzare l'ObjectContext ApplicationData da WCF Ria Service

I think you’ve nailed it! would you mind updating your blog with more information?
22/08/2017 08:56 | rolex replica
Gravatar

# useful

The article very well describes the steps to perform this action and it seems to be pretty useful for all students as well as professionals. But as a beginner, I feel some difficulty to understand the same.
22/08/2017 16:17 | Babylon City Tours
Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET