0

Exception Message:

The number of members in the conceptual type 'Model' does not match with the number of members on the object side type 'Model'. Make sure the number of members are the same.

I am not exactly sure what code I need to post because there is a lot to it. I am using MEF or what I like to call "magic" and I am not very familiar with it.

Possible relevant code:

public ObjectSet<BasicAccount> BasicAccounts
    {
        get
        {
            if ((_BasicAccounts == null))
            {
                **_BasicAccounts = base.CreateObjectSet<BasicAccount>("BasicAccounts");**
            }
            return _BasicAccounts;
        }
    }

The line with stars surrounding it is where the exception happens.

This is thrown after these lines of code are executed in another class:

AccountRepository acctRep = new AccountRepository();
ObservableCollection<BasicAccount> Accounts = new ObservableCollection<BasicAccount>(acctRep.GetBasicAccountList().Cast<BasicAccount>());

If you need to see anymore code, just let me know and I will try to quick to post it.

Any help is appreciated!!

Jehof
  • 34,674
  • 10
  • 123
  • 155
JLott
  • 1,818
  • 3
  • 35
  • 56

1 Answers1

0

Hi This error means that the generated classes representing your model are not in sync with your model definition xml. Try regenerating them (either by moving something around int he EF designer or right clicking on the edmx file and selecting Run Custom Tool). I hope this will help.

yo chauhan
  • 12,079
  • 4
  • 39
  • 58
  • Thanks! It worked out fine and I didn't have to manually go through and find the issue! – JLott Feb 19 '13 at 16:01