Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Edited Unassigned: Confusing error message is thrown by .HasDeleteAction() [1212]

$
0
0
Repro:
1. New console application
2. PM> Install-package entityframework -pre -version 6.0.0-beta1-20531
3. replace Program.cs with attached file
4. Debug the application (F5)
NOTE: Exception is thrown

One of the error messages generated by this code looks like this:
(0,0) : error 0005: The 'Action' attribute is invalid - The value 'Restrict' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2009/11/edm:TAction' - The Enumeration constraint failed.
(0,0) : error 0096: The Action Restrict on Comment_Parent_Target is not recognized. Valid actions are: None, Cascade, and Restrict.

Convention looks like this:
modelBuilder.Types<Comment>()
.Configure(c => c
.NavigationProperty(t => t.Parent)
.HasDeleteAction(OperationAction.Restrict));

Viewing all articles
Browse latest Browse all 10318


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>