Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5947457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:58:01+00:00 2026-05-22T16:58:01+00:00

I have a [Product]-1-*-[Component]. So when I delete a product, I want EF to

  • 0

I have a [Product]-1-*-[Component]. So when I delete a product, I want EF to delete all its components. In the designer I select the relationship and set the OnDelete property for End1 to Cascade, whose multiplicity is 0..1 – this generates something like:

ALTER TABLE [dbo].[Components]
ADD CONSTRAINT [FK_ProductComponent]
    FOREIGN KEY ([Product_Id])
    REFERENCES [dbo].[Products]
        ([Id])
    ON DELETE CASCADE ON UPDATE NO ACTION;

which to me, means that when a component is deleted, the deletion should cascade and the related product should also be automatically deleted.

This is backwards from what I wanted. So I edited the property for End2 to Cascade (End1 gets reset to None) but when trying to save the model I get:

Error   28  Running transformation: End 'Text' on relationship 
'EF.ProductComponent' cannot have operation specified since its multiplicity 
is '*'. Operations cannot be specified on ends with multiplicity '*'.   C:\Users
\me\Documents\Visual Studio 2010\Projects\X\Website\Models\EF.edmx

clearly I don’t understand this. it IS possible to do what I want, no? how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:58:02+00:00Added an answer on May 22, 2026 at 4:58 pm

    Here is a good link that explains it in detail. But in short, EF isn’t very dependable in handling cascade deletes. You should set this up on the database end manually because EF probably didn’t.

    http://blogs.msdn.com/b/alexj/archive/2009/08/19/tip-33-how-cascade-delete-really-works-in-ef.aspx

    And the second part of my answer is….. A cascade delete works such that if you delete a parent… all the children get deleted as well. Deleting a child has no effect on the parent whether you have cascade delete on or not.

    And yes, the ON DELETE CASCADE should appear on the child table’s foreign key constraint.

    Another link with good info: http://msdn.microsoft.com/en-us/library/ms186973.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a solution with many components and each component has its own version
I have such model now: receipt contains components. component contain product. The difference between
For my product I have several components into it. But all the components don't
I have created a bundle product in Magento 1.4.0.1. All the components of the
I have a Product Service. On each call to Service, I want to call
I have a Quiz.Component.Product.Type and a view that provides the component. when the Create
I have this string manipulation select product, CAST((LENGTH(currencies) - LENGTH(REPLACE(currencies, '*', ''))) / LENGTH('*')
Let's say I have the following entities: Store: component { property name=Id fieldtype=id generator=native;
I have some entities with relationships: component name=Store persistent=true { property name=Products fieldtype=one-to-many cfc=Product;
I have an Eclipse product build using features. All of the services are registered

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.