SharRepository delete and Table Splitting

175 views
Skip to first unread message

sms sidibé

unread,
Oct 1, 2014, 12:11:59 PM10/1/14
to sharpre...@googlegroups.com
Hi,

I'm using sharpeRepository to select data from a sqlServer database.

I have
mapped  2  entities E1 and E2  to a  table T.

There is a   one to one relationship between E1 and  E2.

So in E1 we have a E2 field  (E2 is loaded lazy)
And in E2  we have a E1 field. 

Now I want to delete  a line from table T.

When i do Repository.delete(E1)  this error occurs :
Invalid data encountered. A required relationship is missing. Examine StateEntries to determine the source of the constraint violation.


Please how can i delete  line  from the table with such  configuration type ?





Jeff Treuting

unread,
Oct 1, 2014, 5:22:46 PM10/1/14
to sms sidibé, sharpre...@googlegroups.com

This sounds like an EntityFramework issue. 

 

If I’m understanding you correctly, you either need to delete the related entities first or setup cascading delete so that EF handles the deleting of the related entities for you.

 

Jeff

--
You received this message because you are subscribed to the Google Groups "SharpRepository" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sharpreposito...@googlegroups.com.
To post to this group, send email to sharpre...@googlegroups.com.
Visit this group at http://groups.google.com/group/sharprepository.
To view this discussion on the web visit https://groups.google.com/d/msgid/sharprepository/9b900942-ec96-4bd7-952f-fd108f284bb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages