1

Is there any method in .NET framework that is equivalent for method OnModelCreating in.NETcore?

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity("DataAccessLayerInterfaces.Entities.Employee", b =>
...

}

1 Answer 1

2

You should be able to define it like this :

protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
    modelBuilder.Entity<DataAccessLayerInterfaces.Entities>()
                .HasOptional(x => x...)
                .WithOptionalPrincipal(x => x...)
                .WillCascadeOnDelete(false);
     ...
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.