Doubts about EF6 cascade deletion

1. In EF, when we set a primary key and a foreign key, EF will automatically generate cascading deletions for us, but I have read some articles and some authors say that cascading deletions will not occur if the foreign key is set to nullable. Then I wrote something like this on the side of the data annotation: public int? Xxx (); to indicate that the foreign key is empty, but I reported an error when I deleted the table referenced by the foreign key.
2. So I would like to ask whether this method is supported by previous versions of EF, or is it impossible, or should I use the fluent API way (optional) to configure foreign keys can be null?
I don"t know much about EF, so please give me some advice. Thank you!

Mar.19,2021
Menu