Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# linq query map to entity

protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
    modelBuilder.Entity<User>().ToTable(tableName: "users");
    modelBuilder.Entity<WorkPlace>().ToTable(tableName: "workplaces");
    modelBuilder.Entity<User>()
        .HasRequired(user => user.Place)
        .WithMany(place => place.Users);
}   
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #linq #query #map #entity
ADD COMMENT
Topic
Name
2+5 =