The selected class cannot be deleted because it is used as a return type for one or more DataContext methods
The return type of one or more DataContext methods is the selected entity class. Deleting an entity class that is used as the return type for a DataContext method causes the compilation of the project to fail. To delete the selected entity class, identify the DataContext methods that use it and set their return types to a different entity class.
To revert the return types of DataContext methods to their original auto-generated types, first delete the DataContext method from the Methods pane and then drag the object from Server Explorer/Database Explorer onto the O/R Designer again.
To correct this error
Identify DataContext methods that use the entity class as a return type by selecting a DataContext method in the Methods pane and inspecting the Return Type property in the Properties window.
Set the Return Type to a different entity class or delete the DataContext method from the methods pane.
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for