Skip to main content

Richard Webb

Richard Webb's Public Library

  • Configuring a Composite Foreign Key

    If the primary key on the Department type consisted of DepartmentID and Name properties, you would configure the primary key for the Department and the foreign key on the Course types as follows:

        
     
    // Composite primary key 
    modelBuilder.Entity<Department>() 
    .HasKey(d => new { d.DepartmentID, d.Name }); 
     
    // Composite foreign key 
    modelBuilder.Entity<Course>()  
        .HasRequired(c => c.Department)  
        .WithMany(d => d.Courses) 
        .HasForeignKey(d => new { d.DepartmentID, d.DepartmentName });
     
      

  • Isolating the Scope of a Directive
  • Best Practice: Use the scope option to create isolate scopes when making components that you want to reuse throughout your app.
  • the isolate scope of the directive isolates everything except models that you've explicitly added to the scope: {}

6 more annotations...

1 - 20 of 4472 Next › Last »
20 items/page

Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »

Join Diigo