entity framework - Error 3033: Prblm in mapping fragments:EntitySets 'Entity1' and 'Entity2' are both mapped to table 'Addresses'. Their primary keys may collide -


context. want separate shipping table 2 tables, first 1 general data shipping used , in second table store pickup , destination addresses in different records selector field recordtype, in order retrieve addresses information when required. purpose, created 3 entities, entity move shipping general information, entity pick address , entity destination address, last 2 entities have additional field "address type" distinguish pickup , destination. mapping details screen in model mapped both entities, pickupaddress , destinationaddress same table moveaddresses, pickupaddress codition recordtype =”p” , destinationaddress condition recordtype = “d”. when rebuild datalayer solution got following errors

error 2 error 3032: problem in mapping fragments starting @ line 625:condition member 'moveaddresses.addresstype' condition other 'isnull=false' mapped. either remove condition on destinationaddresses.addresstype or remove mapping.

error 4 error 3033: problem in mapping fragments starting @ line 647:entitysets 'pickupaddresses' , 'destinationaddresses' both mapped table 'moveaddresses'. primary keys may collide.

please let me know doing wrong. in advance help.

what trying implement table per hierarchy. description, sounds using entity framework designer surface. model table per hiearchy in entity framework designer multiple step process.

  1. create entity represents table hold multiple bound entities (in case, create address entity addresses entity set, matching entire addresses table). forget move table moment, care @ moment table sharing data.
  2. right click designer surface, add -> entity, set base type of each derived entry address i.e. pickupaddress derived address
  3. cut , paste specific entries belong each derived entity, removing them base entity , pasting them derived entity. i.e. pickup date moved address pickupaddress.
  4. delete descriminator property base entity. isn't property can used directly entities.
  5. right click each derived entity, choose table mapping. choose base table mapping, , set discriminator values.
  6. now ready create entity relationships between derived classes , other table necessary.

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -