D
D
Dudki2017-09-05 09:25:50
ASP.NET
Dudki, 2017-09-05 09:25:50

Am I reading the OnModelCreating(...) function statement correctly?

I 'm reading the section of the tutorial about creating class ApplicationDbContext :
Context .HasForeignKey(c => c.UserId).OnDelete(DeleteBehavior.Restrict); } Tell me, am I correctly translating it into logical Russian as "The Comment entity has one Author, which (maybe) have many Comment, which have a ForeignKey on the UserId of the User entity, when deleting which, the Comment entities are not deleted"? Or is there something else?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Ivanov, 2017-09-05
@Dudki

Everything seems to be so. Only the entry should start like this:
modelBuilder.Entity<Comment>()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question