I have a record of categories for a store now I want set relationship between 2 categories I mean, I want to put these categories under each other This is how I wrote the model:
public class Categories
{
.
.
[ForeignKey("FatherId")]
public Categories Father { get; set; }
public int FatherId { get; set; }
.
.
}
But I got this error: Introducing FOREIGN KEY constraint 'FK_Categories_Categories_FatherId' on table 'Categories' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints. Could not create constraint or index. See previous errors.