How can I have multiple instances of a column that itself holds a foreign key reference?

I am new to Visual Studio so to start learning it I first of all downloaded a sample available at https://code.msdn.microsoft.com/ADPNET-Entity-Framework-2d1160cb and started working around it. Since I have fairly good knowledge of VB6 and SQL it did
not take much time for me to understand the whole pattern the sample is based on. Had Microsoft given a detail explanation or a walk through of the sample it would have been much easier to understand the basics. However, I somehow managed to work around it
and have build a small desktop application in wpf using Entity Framework and MVVM. But a point has come where I have got completely stuck up finding no way out. The problem is as under:
I have two tables. 1 Advocate and 2 Party. Table Advocate would contain names of advocates and would have a primary key. Similarly Party would have names and their respective primary keys.
Then I have another two tables 1. Case and 2 CaseDetail. Table Case would simply hold three columns: 1. CaseId 2. CaseNo and 3. Year. Table CaseDetail would have CaseDetailId as a primary key the CaseId as a Foreign Key. Now what I need is that a particular
case could have multiple advocates and multiple petitioners. So the table CaseDetail would have two columns to hold advocateId and PartyId as a Foreign Keys. 
If you look at the sample referred above you would not find how to deal with such a case. When I follow the pattern of the sample I get host of design time and runtime errors. 
Therefore, please suggest what strategy should be adopted in a scenario described above while developing WPF application using Entity Framework and MVVM.

I am new to Visual Studio so to start learning it I first of all downloaded a sample available at https://code.msdn.microsoft.com/ADPNET-Entity-Framework-2d1160cb and started working around it. Since I have fairly good knowledge of VB6 and SQL it did not
take much time for me to understand the whole pattern the sample is based on. Had Microsoft given a detail explanation or a walk through of the sample it would have been much easier to understand the basics. However, I somehow managed to work around it and
have build a small desktop application in wpf using Entity Framework and MVVM. But a point has come where I have got completely stuck up finding no way out. The problem is as under:
I have two tables. 1 Advocate and 2 Party. Table Advocate would contain names of advocates and would have a primary key. Similarly Party would have names and their respective primary keys.
Then I have another two tables 1. Case and 2 CaseDetail. Table Case would simply hold three columns: 1. CaseId 2. CaseNo and 3. Year. Table CaseDetail would have CaseDetailId as a primary key the CaseId as a Foreign Key. Now what I need is that a particular
case could have multiple advocates and multiple petitioners. So the table CaseDetail would have two columns to hold advocateId and PartyId as a Foreign Keys. 
If you look at the sample referred above you would not find how to deal with such a case. When I follow the pattern of the sample I get host of design time and runtime errors. 
Therefore, please suggest what strategy should be adopted in a scenario described above while developing WPF application using Entity Framework and MVVM.

Similar Messages

  • How can I select multiple songs in iTunes without having to hold the Command key while clicking each individual song

    Trying to drag a block of songs from iTunes into TuneUp and I have about 1800 songs to bring in.  TuneUp maxes out at 1000 songs per batch, so I can't use Select All, but I also don't want to Command + Click 800 times to get all of those songs selected. 
    Thanks in advance. 

    Answered my own question.  Select song at the beginning of the list.  Hold down the shift key.  Go to the last song you want in your list.  Click that song.  All songs in between will be highlighted.  Such and idiot. 

  • How can I have multiple users on iTunes (in order to connect to a shared office iPad)?

    How can I have multiple users on iTunes (in order to connect to a shared office iPad)? Currently each of us has our own iTunes account, so I've made an "all office" Apple ID. However, I can't seem to get two different accounts (my personal and the office) to work on my machine. Even when I login as "the office", my personal library is still showing. Additionally, when I try to setup with a first-time use in iTunes, I get an error that I don't meet the minimum age requirement - no matter what birthdate I enter!

    The library exists regardless of which user is logged in.
    The only way around that is to create different user accounts on the computer.
    There is no way to have 20 unique iTunes users access a shared iTunes under a single login on the computer.

  • How can I have multiple users on one apple id?

    How can I have multiple users on one apple ID?
    ie: I have my apple ID with my own credit, how can I set up credit for my son under the same apple ID, so that he can still access the same apps I've already downloaded and paid for?

    I've been trying to figure out a clean way to do this too. I think you may need more than one Apple ID – one that is shared and used to purchase "sharable" items and then "individual" Apple IDs for you and your son. That's the idea that I'm pursuing for the moment.
    It seems that there must be a way to do this, App Store purchases for the Mac are licensed across multiple machines. iPhone app purchases have "all your devices" licensing. Makes me think that Apple has a process in mind for sharing an account (or associating a device with multiple accounts).
    Other things I've learned:
    - Apparently you can't merge Apple ID accounts. I asked about this once at an Apple Store and was told that there was no way to do it.
    - If you share an Apple ID the Messages app behaves in a somewhat surprising manner. It must use your Apple ID to decide where messages should be sent because all users get all messages. This can make it very hard to organize a surprise party :-)

  • How can I have multiple WINDOWS (NOT tabs) with INDEPENDENT content?

    How can I have multiple '''windows''' (''not ''tabs) with '''independent''' content?
    I used to be able to open separate windows with Firefox, and the content could be completely different in each window. No matter what I did in any window, no OTHER window open at the time, nor any of the content therein, was affected. This is no longer the case and it is extremely frustrating for me.
    I do ''not ''like tabs and do not use them. I prefer multiple windows plus I am so used to using them, for so many years now! But with v9.0.1 I suddenly can no longer do what I've always done with my browser without this aggravating problem constantly reminding me that I can't have what I want in firefox anymore.
    Or can I? Does anyone have a solution I don't realize exists?
    Thanks,
    Sowelu

    AppleScriptObjC can use pretty much everything in the Cocoa API, so yes, it is possible.
    Note that a view is not the same as a window, and a window can have multiple views. There are also many ways to implement "tabs";  take a look at some of Apple's applications - they use various mixtures of toolbars, checkboxes, and radio buttons, for example.  An application such as this will be a lot more involved than what you have done so far though, using custom classes and subclassing existing ones, so be prepared to do a lot of reading and researching.

  • HT1766 How can I have multiple iphones on itunes and prevent them from having the info from one ipone going to the other

    How can I have multiple iphones on itunes without them sharing contact info

    If contacts on each iPhone are being synced direct with the same supported address book app on the computer via the iTunes sync process, deselect Sync Contacts under the Info tab for the iPhones that you don't want synced with the same address book followed by a sync.
    If each iPhone is sharing the same Apple iCloud account with Contacts enabled for over the air syncing, each iPhone needs its own iCloud account.

  • How can I have multiple accounts and only one library

    How can I have multiple accounts and only one library that all the purchased items feed into?

    ask your wireless provider.

  • How can I have multiple views for my question

    When I posed a question on a forum, it indicates that I have one (1) view. How can I have multiple views on the same question?

    I believe the number you are looking at is the number of times a particular thread has been looked at (viewed) by different users. When someone else opens your question, the view count should increase.
    Justin

  • How can I have an instance of mx.controls.List in a SWF from Flash?

    How can I have an instance of mx.controls.List component in a Flash, and import its SWF into a Flex application so it can controll it?  Is it possible to do this either at author-time or runtime?
    I see plenty of examples of how you can import a SWC into Flex, but how can I have my Flash interface, with Flex components already in place to be consumed by Flex?
    Thanks

    Hallo, here is more code for my problem:
    class Login {
       Devisen dev=new Devisen();
    class Devisen {
       JTextField field2;
       if (!Check.check_field2()) return; // if value not okay than return
    class Check {
       public static void check_field2()
         HOW TO GET THE CONTENT OF field2 HERE ?
    One solution ist to give the instance to the static function, with the keyword "this"
    if (!Check.check_field2(this)) return;and get the instance
    public static void check_field2(Devisen dev)BUT is that a problem for memory to give every method an instance of the class ? I have 50 fields to control and I dont want do give every check_method an instance of Devisen, if this is a problem for performance.
    Or do I only give the place where the existing instance is.
    Hmm...?
    Thank you Wolfgang

  • Can we have Multiple Instance on same Node in Oracle 10g RAC

    Hi All,
    I am planning to implement the RAC in Oracle 10g.Before that i have one doubt regarding RAC.
    My question is "Can we create multiple Instance on Same node(Server) ?"
    is it possible.
    Any ideas or thoughts would be apperciable.
    Thanks in Advance.
    Anwar

    This is where it is important to keep the separation between 'database' and 'instance'.
    A database is the set of files that contains the data (and the redo, control files, etc). A database does nothing by itself, other than take up lots of disk space.
    An instance is theCPU cycles (running software) and the memory to control the database.
    In Oracle RAC, you can have as many instances controlling one database [at the same time] as you want (within reason). Each instance must be able to access the disk(s) that contains the database.
    These multiple instances can be on the same computer (effectively taking up a lot of server memory and CPU for nothing) or they can be on separate computers.
    If they are on separate computers, the disk subsystems must be able to be shared across computers - this is occasionally done using operating system clusterware and is the main reason why clusterware is required at all. (This is also the toughest part of the pre-requisites in setting up a RAC and is very vendor dependent unless you use ASM.)
    These instances need a communication connection to coordinate their work (usually a separate network card for each computer) so they do not corrupt the disk when they are trying to access the same file, and possibly the same block, at the same time.
    In a RAC configuration, instances can be added, started, running, stopped and removed independent of each other (allowing a lot of high availability) or can be started and stopped as a group.
    Each instance gets it's own SID, which is in no way any different than a non-RAC SID. It's just the name of a service that can be invoked. The neat thing is that the SID
    a) helps the DBA keep things straight by lettiung us talk about 'instance A' (the Oracle software to be running over on computer A) vs 'instance B' when starting, stopping and managing;
    b) helps the application by providing targets that can be listed in the TNSNAMES.ORA [against one service alias], which is used by ORacle Networking to provide automated load balance or failover (instance/SID a is not available, I guess I'll try the next in the list)
    Hope that helps the concept level a bit.

  • How can you have multiple, different css link styles?

    Every time I want to create a different looking link just for some copy, it always reverts to the A:link style, even if I create a new style that looks just the way I want. How can I create multiple link styles and then be able to select the one I want at any time???
    I would greatly appreciate any help.
    Allan

    How are you applying the different styles to your links? In most cases, it's easiest to wrap the link(s) in an element, like a < div > that has a class or ID assigned, for instance class="altLinks". Then, set up the CSS style names like:
    .altLinks a:link
    ...and so on. Then, the styles would just apply to links within the element(s) with class "altLinks". Here's a tutorial that might also help:
    http://www.golivecentral.com/pages/tutorials.shtml#basicCSSlinks2
    Otherwise, if you're still having trouble, post back with a link to your page so we can see what's going on.

  • How can you open multiple instances in Safari?

    I am new to the Mac world. I was so used to having multiple instances of Internet Explorer open when I used a Windows PC. Can anybody please explain to me how can I open multiple Safaris? Thank you for answering my question.
    McCam.....new to the iMac world.

    Hi McCam,
    Welcome to the world of Macs
    Open Safari, and then under the File menu you can open a new window (or press command+n to do the same thing - the command key is the one with the Apple symbol on it).
    Hope that helps.

  • How can I open multiple instances of the same version of FF?

    I understand that if I have multiple profiles, I can run different versions of FF side-by-side (like 3.6 and 4).
    However, what I'm interested in is how I can launch multiple instances of the same version of FF (4, for instance) using the same profile. In other words, I want to be able to double-click the desktop icon for FF, and open a new instance, and keep doing that as many times as I want. I don't want to have a different icon and profile for each instance (too much overhead to keep a dozen+ profiles in sync).
    I can always launch one FF window instance, and then keep clicking ctrl+N to launch new instances from inside it, which they all share the same profile (as I want). So, basically, I want to be able to do that from my desktop icon, rather than by having to do it with the keyboard ctrl+N sequence.

    But I don't understand why whatever Firefox does when you click ctrl+N can't also be done (with some sort of command-line switch) from a desktop icon?
    In other words, I clearly can create many FF instances (even if they are the same FF.exe process) by doing ctrl+n a bunch of times. Why then can't this behavior be done from a desktop icon with some parameters?
    As far as I know, FF is the only browser that doesn't directly allow multiple browser instances from desktop icons. IE, Chrome, Safari, Opera, etc... all let me launch a new instance (even if they are all single process and the instances are shared within the process).

  • How can i run multiple instances of Photoshop EXE at the same time on windows 7

    Alright. You may ask why do you need multiple ?
    Assume that i have 10000 PSD files in 10 different folders
    I have a script that just save as them as PNG
    And these files are each 3000x3000 px
    My computer has 8 cores and 1 photoshop exe is only using 1 cpu core
    Also i have SSD raid system it has 750 mb read write per second
    So right now i am wasting my time with running only 1 photoshop exe instead of at least 4

    I'm not aware of a way to run multiple instances or different versions of photoshop at the same time on windows.
    Assuming of course they are all installed on the same operating system.
    On mac versions you can running two different versions of photoshop at the same time, but i don't think that's possible on windows where it
    appears that only one version of photoshop can run at a time.

  • How can I run multiple instances of an app in netbeans?

    Hi,
    I would like to run multiple instances of an app in netbeans, this is essential when making GUI changes and you want to compare them with the older version.
    Thanks in advance,

    It is still true that Netbeans cannot launch the same project twice, even with the latest 7.2 and JavaFX Beta version. When trying to "run" the second instance, Netbeans tries to rebuild the project jar file but can't delete it because it is "locked" by the first instance.
    For JavaFX projects, I start one instance by double-clicking the jar file (in the project's dist folder), then use Netbeans to launch the second instance. For comparing your app's old vs. new screens, save the old app version by copying the project folder to another place and use the double-click jar to launch the old app, then proceed to revise the new app version and launch it under Netbeans. That's how you run one version "outside" another version.

Maybe you are looking for

  • Authentication and authorization for a custom connector

    I have the following problem: I have a software which tries to connect with the server through its own custom RMI connector. So I have the  RMI Connector deployed via Mlet-Service. I have written a small TestClient and can get a RemoteMBeanServer  wi

  • Dual screen over HDMI

    I'm running arch on my HP mini 311. It has nvidia ion graphics and I'm using the nvidia driver package. I would like to set it up to use dual screen over the hdmi port. I am having trouble getting my xorg.conf setup. I tried configuration that I thou

  • Integrating BOBJ XI 3.1 with GRC AC 5.3

    Hi all Has anyone worked on integrating BOBJ with GRC Access Control 5.3. We have been using GRC CUP for access provisioning all the SAP (ECC, BI, Portal) systems. Now, we have integrated SAP Business Objects Enterprise XI 3.1 with our SAP BW system.

  • ITunes reading external hard drive.

    My iTunes library was on an external hard drive. I got a new external hard drive and transfered everything over to the new drive. iTunes sees the music but it asks me to locate each song before it will play. I have to go through folders to find the e

  • ITunes installer won't work

    First, sorry for my English. I'm having an issue installing iTunes after format my computer (using ORIGINAL Windows 7 Home Premium, wich worked fine with iTunes before the format). I've downloaded the last iTunes version from Apple site, but when I t