none
Please help with this exception:

All replies

  • Hi Val,

    Your exception message didn't make it to the post.  Please send it again.   Thanks.


    Tom Overton
    Thursday, October 27, 2011 10:17 PM
  • Hi,

    Would you please send it again, thanks!

    If you need further assistance, please feel free to let me know.I will be more than happy to be of assistance.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, October 31, 2011 2:16 AM
    Moderator
  • just joke?

    Thanks,

    Werewolf,


    Just a newbie for everything.
    Wednesday, November 02, 2011 4:30 PM
  • Sorry but I figured my problem and lost the message and then it took me several days until I got it again on different occasion. The point in my original post (I have no idea why it didn't make it the first time...) was that yes, I know I have a problem but the exception message has some info which probably would help me to locate the problem easier. Here is the message:

    MappingException:
    (169,10) : error 3034: Problem in mapping fragments starting at lines 169, 211:Two entities with different keys are mapped to the same row. Ensure these two mapping fragments do not map two groups of entities with different keys to two overlapping groups of rows.

    (185,10) : error 3034: Problem in mapping fragments starting at lines 185, 211:Two entities with different keys are mapped to the same row. Ensure these two mapping fragments do not map two groups of entities with different keys to two overlapping groups of rows.

    (198,10) : error 3034: Problem in mapping fragments starting at lines 198, 211:Two entities with different keys are mapped to the same row. Ensure these two mapping fragments do not map two groups of entities with different keys to two overlapping groups of rows.

    (229,10) : error 3032: Problem in mapping fragments starting at lines 211, 229:EntityTypes Magnifeye.Data.Repository.Camera, Magnifeye.Data.Repository.MessageSign, Magnifeye.Data.Repository.VehicleDetector, Magnifeye.Data.Repository.EventsImporter, Magnifeye.Data.Repository.UserDevice, Magnifeye.Data.Repository.ChpDispatch are being mapped to the same rows in table EventSource. Mapping conditions can be used to distinguish the rows that these types are mapped to.

    My question is how do I read this message? Is there any way to locate the mapping problem in my fluent API code? What are these lines cited in the message?


    Thanks Val

    • Edited by Valo Saturday, November 05, 2011 1:17 AM
    Saturday, November 05, 2011 1:17 AM
  • Look into the .edmx file. Open it by the XML editor, not the designer.
    ----------------------------------
    http://jendaperl.blogspot.com
    A Perl developer in the world of C#
    Tuesday, November 08, 2011 6:28 PM
  • Thanks Jenda,

    But like I said I use fluent API - no xml files. Which actually leads me to a related question: on a Database level you can dump tha DB creation script. It would be very cool if there was something similar that would dump the schemas. (BTW, Fluent NHibernate has that feature - you can make it spit out the mapping .hbm files.) Next time when the EF team calls for feature requests, I'll put this one.


    Thanks Val
    Wednesday, November 09, 2011 8:27 PM
  • I see ... yet another definition of the "fluent API" term. Or rather a fluent API used in one of the ways you can set up and use Entity Framework. You should have said you are using Code First.

     

    Then it's whatever you use to specify how the classes map to tables. Seems two different classes are mapped to the same table, yet they define the primary key differently. The last message looks like actually all those classes mapped to the same table ... is that what you wanted?

     

    Anyway it seems the line numbers relate to a XML that EF created internally and doesn't make available.  


    ----------------------------------
    http://jendaperl.blogspot.com
    A Perl developer in the world of C#
    Wednesday, November 09, 2011 10:15 PM
  • Accessing the XML file when using Code First...

    see "View Entity Data Model XML" at

    http://blogs.msdn.com/b/adonet/archive/2011/05/18/ef-power-tools-ctp1-released.aspx

    "View Entity Data Model XML...Displays the EDMX XML representing the Code First model."
    • Edited by NoisyKeys Sunday, May 06, 2012 4:02 AM
    Sunday, May 06, 2012 4:01 AM