How to convert sample project using EF4, ObjectContext -- to EF5 DBcontext?

I have been working with (wrestling with) trying to create a copy a small sample project -- that is actually 3 project -- a class library containing an ADO.Net Entity Data Model (EF4) which uses ObjectContext, a WCF service application project (that
connects to the Entity Data Model), and a WPF client which consumes the (data?).  This sample was created in VS2010.  I am trying to create a copy of this sample project in VS2012 (with EF5 and DBContext). The VS2010 sample works fine.  A .zip
of the sample project (the sample I'm working on -- which I have removed a few additional projects that were included in the original sample project) can be downloaded
here
The .zip also contains the sample database (called SkiResultDB, mdf & ldf -- which I recreated the sample database from the original because the name was too long and had too many periods in the original -- but hey, everything still works in
this sample). 
The sample project also uses
[assembly: EdmSchemaAttribute()]
attribute in the .edmx ...Designer.cs
  It looks like this:
[assembly: EdmSchemaAttribute()]
#region EDM Relationship Metadata
[assembly: EdmRelationshipAttribute("myDataBindingModel", "FK_Competitor_Event", "Event", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(SkiResult.Data.Event), "Competitor", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(SkiResult.Data.Competitor), true)]
#endregion
"myDataBindingModel" is used 25 times through the designer.cs and the .edmx xml file (I renamed that bindingModel to myDataBindingModel -- to see if it would still work, and it did).
here is what the designer.cs looks like (at a glance)
When I try to create an ADO.Net Entity Data Model from the template list -- I just get bare bones --   ... : DBContext and none of the stuff that the original .edmx ... Designer.cs had.  But in the EF5 entity data model I do get
...edmx...context.tt which contains ...context.cs, but does not contain any of the methods in the original .edmx. 
My request is if someone could explain -- just the class library part of this sample project for now -- how I could create an ADO.Net Entity Data Model like the original but in VS2012 (EF5) which does everything that the original ADO.Net Entity
Data model does, the attribute decorators (did the author do that -- or was that generated by VS2010 or some other tool?).  Note:  I got this sample project from
http://www.software-architects.com/devblog/2010/09/10/MVVM-Tutorial-from-Start-to-Finish
which includes 8 (short) videos, very concise tutorial (the original sample project also included a Silverlight client and a unit test -- which I removed for simplicity  from my sample).  In the first video, the author specifically states
that THIS tutorial is not about entity framework and thus did not explain much.  The first video just shows him selecting an ADO.Net Entity Data Model from the template collection and just clicking on the wizard.  I suspect that Entity
framework was the "Fundamental" part of this sample project. 
Any Suggestions appreciated.
Rich P

Hello Rich ,
>>My request is if someone could explain -- just the class library part of this sample project for now…
With the release  of the Entity Framework 5, the team uses the DbContext API installed of ObjectContext and the DbContext is recommended. In your case, since the project already uses the ObjectContext, I think it might be not easy to change
it to work with the DbContext, you could follow steps as below to make the project still work with the ObjectContext AP:
1. It still needs you to create the ADO.Net Entity Data Model in VS2012
2. After you created the model, delete the XXX.Context.tt and XXX.tt files, they are used to work with the DbContext.
3. In the designer windows, right click and select the properties, change Code Generation Strategy to Default/Legacy Object Context and save the designer windows.
It would generate the entities are similar with the one you show in the image.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How to publish MVC project using WebDeploy from TFS Build

    Please help me on how to publish MVC project using WebDeploy from TFS Build

    Hi Jeevan,
    You might want to setup an TFS build server for web deployment. Please refer to the link for the details:
    http://www.asp.net/web-forms/overview/deployment/configuring-team-foundation-server-for-web-deployment/configuring-a-tfs-build-server-for-web-deployment
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to re-size project using flash bulider to be the same size in all screens

    Hi,
    Im develop  a chat project using flash bulider, my question is how i make sure that the porject when open from diffrent screens size no change,
    becouse after i finish th chat project i publish on website later i discover this problem for example when i access project from screen have size 17 or 21
    is work fine but in the same time i access from my notbook that him screen is 14 is not work and seems the project is mixed the webcamera no appear complete also other function dosent appear complete like sharescreen.
    can some help  guide me to find the way that i access the project whatever screen size is work fine and not mixed od disappear functions.
    Thanks,

    What email are you using?
    The easiest way to send pictures is to use Apple's Mail.app that is part of the OS - it DOES NOT require a .Mac account.
    If you are using a purely web-based email account, the File>Export method is the easiest.

  • How to display sample text using dynpage ?

    Hi All,
             I am developing the portal using dynpage technology.  I do not know whether I am posting this thread in the right place.
    How to display a sample text in the portal using dynpage?
    I have written it using HTMLFragment.  But it could not recognise the <> tags it seems.
    I am getting error in < and in \.  Can anyone pls help to resolve this?
    I tried with normal html tags.  It could not recognise the tags.
    Pls suggest.
    Regards,
    Subashini.
    Edited by: Subashini on Sep 16, 2008 7:48 AM

    Do read through this tutorial.
    http://help.sap.com/saphelp_nw70/helpdata/EN/95/cfa441cd47a209e10000000a155106/frameset.htm
    Thanks,
    GLM

  • How to run SWT project using Netbeans?

    I get run time exception:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-pi-gtk-3236 in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1030)
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
    at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
    at org.eclipse.swt.widgets.Display.<clinit>(Display.java:126)
    at swttest.Main.formLayout(Main.java:41)
    at swttest.Main.main(Main.java:36)
    Java Result: 1
    thanks;

    UnsatisfiedLinkError is a native library error, not classpath error, not to mention it's very common when starting to work with SWT. I've never tried SWT with NetBeans, in fact I don't use NetBeans much at all, I use Eclipse, personal preference, I've tried NetBeans but I'm just more comfortable with Eclipse. Anyway, to get this to work you need to add this argument to the launch configuration:
    -Djava.library.path=*path to the SWT dlls*
    There should be 3 of them and you just have to put the path to that directory, not each individual DLL.
    Being unfamiliar with NetBeans I can't tell you exactly how to do this, but I assume there is some sort of launch dialog where you can specify JVM arguments. Hopefully this helps.

  • How to convert files for use in iMovie?

    I have ripped some home movie footage from DVD using mactheripper to my harddrive.
    Coolio.
    Now, how on earth to i get the files into iMovie?
    I'm guessing I need to convert the files somehow but how? Using what?
    Please tell me the procedure, thanks, R

    ... am a mac newbie and...
    .. then, you shouldn't stroll around in the outer rims of the iNet, looking for MTR.. , this app is mostly intended for distracting copy protection from commercial dvds...
    give that app a try:
    DVDxDV (free trial, 25$, Pro: 90$)
    legal, handy, very Mac-like in usage... plus a free trial, you can test, how it works for you....
    just to mention that:
    DVD uses a plyback-format, end-of-the-road, delivery standard.. not meant for further processing.. you will recognize a (dramatic) loss in pic quality..

  • How to convert date without using conversion exit?

    hi!! Guys,
         please can anybody help me how to compare date which is not in actual format
    i.e. (when comparing  BKPF-budat with TCURR-gdatu in where condition of a Select query its giving syntax error  "when you use the addition 'fOR ALL ENTRIES IN itab' the fields gdatu and it_bkpf-budat" must have the same type and the same length. its very urgent...
    thanks in advance.
    akanksha.

    try like this.
    data : year(4),
             mon(2),
    day(2).
    in itab declare field cbudat(8) type c.
    loop at itab.
    year = itab-budat(4).
    mon = itab-budat+4(2).
    day = itab-budat+6(2).
    concatenate year mon day into itab-cbudat.
    modify itab.
    endloop.
    now use select for all entries and check gdatu = itab-cbudat.
    regards
    shiba dutta

  • How to create j2me project using jump developer desktop

    Hi,
    iam not understanding how to launch sun emulator when i execute
    my j2me project in jump developer desktop,
    and it asks for the main() function to execute,
    and i write main() the control stops in main() and
    the control doesn`t go to startApp().........
    can any one plz help me to come out of this????
    Thanks
    Mraj

    Sanjay,
    You might get more help on the XML forum: General XML
    Jim P.

  • How to convert file format using bfile datatype

    <pre>
    Hi all,
    Assume, i has a table BFILE_IMAGE and it table structure is similar like:
    SQL> desc bfile_image;
    Name Null? Type
    IMAGE_ID NUMBER
    FILE_NAME VARCHAR2(30)
    IMAGE BINARY FILE LOB
    SQL>
    Is that impossible if we can use process() function with bfile datatype? similar like:
    ordsys.ordimage.process(image,'fileFormat=JPEG contentFormat=24BITRGB');
    The line above is work with blob datatype but doesn't with bfile datatype. Can you please give me some idea how to deal with it.
    Thanks,
    Kevin

    a BFILE is content stored outside the Oracle database. It is a read-only object.
    process() is an in-place modification of the image. This is only possible with BLOB stored content.
    If you are using BFILE you could use the processCopy() method to create a new copy of the BFILE stored image that has been processed according to your command.

  • I need a working sample project using core graphics in XCode 6

    I've got an old os x app that does not compile in Xcode 6 because several basic things have been deleted.  For now I am OK with 4.6.3 but I'll need to make a jump to 6.0 at some point.  Just need an example combining kiosk mode and core graphics that builds in Xcode 6.0 and OS 10.10.  Any ideas?

    ...yes, I knew that there are no more updates. I was hoping for a super-secret workaround...since the project was originally created in the exact same version that I'm trying to open it in, there might be a bug that someone has figured out.
    Precisely why I use PPro now. FCP is a headache at best...but this...there is no logical reason why this would happen.
    ...borrowed a friends macbook pro w/ FCP 7, it opened...migrated the XML files to PPro...all done now.

  • How to convert pdf files using Windows 8

    I am new to windows 8 and want to know to get to the right window to convert pdf documents to word.

    http://exportpdf.adobe.com
    Message was edited by: Test Screen Name

  • How to convert AVCHD for use on ipad

    Is there a free convertor for mac to convert AVCHD to the format needed for ipad?? i want to try editing with reeldirector on my ipad, i then need to import it to my ipad is the camera kit the only option?

    The Mac application Handbrake should work. It is "free" open source.

  • How to Compile Xcode Project using CodeWarrior

    I had a summer student a few years ago develop a code using Xcode. We now want to use that code on a PC and are having trouble compiling and linking the code using CodeWarrior on the Mac or PC. Does anyone have a simple solution to this problem?
      Mac OS X (10.4.5)  

    Unless you provide more details about specific problems, it is impossible to help you. There is no simple solution.

  • How do you convert a project made in the Trial Version to the full version?

    I purchased the full version and can't figure out how to convert the project
    I made in the trial version to the real thing (still has the "made in trial version" ribbon on the video.  Thank for your help.

    Jeff, the following post by Steve Grisetti explains the process of removing the watermark:
    http://forums.adobe.com/thread/433730?tstart=0

  • How to run "WCF Workflow Service Application" (C# project) using "WCF Test Client" in VS 2013 ?

    I have created a WCF Workflow Service Application of C# project.
    How to run the project using WCF Test Client directly from VS 2013 by doing F5 ?
    Iam using VS 2013 (.NET 4.5.1). It throws an exception to compile c# expressions.
    Can we set any settings in web.config file ?
    Please provide the solution.

    Bhanu Prakash T,
    It surprises me that building a simple WCF Workflow Service Application project in VS 2013 is giving you this problem. That project template should result in a file with an extension of ".xamlx" being generated. With .Net 4.5 and C#, that XAMLX
    file will contain CSharp* activities for the expressions that you specified in the workflow definition. By default, those expressions will be compiled when you use "F5" to execute the workflow.
    Or are you self-hosting the WorkflowServiceHost and loading the XAMLX file yourself using ActivityXamlServices.Load and then creating and managing the WorkflowServiceHost object instance yourself? You must can do the compilation yourself by following these
    examples -
    https://connect.microsoft.com/VisualStudio/feedback/details/741537/cannot-self-host-a-workflow-service-using-c-expressions or http://wf.codeplex.com/discussions/444990.
    Jim

Maybe you are looking for