Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

ef core many to many fluent api

        modelBuilder.Entity<Customer>()
            .HasMany(p => p.Colors)
            .WithMany(p => p.Customers)
            .UsingEntity<Dictionary<string, object>>(
                "CustomerColor",
                j => j
                    .HasOne<Color>()
                    .WithMany()
                    .HasForeignKey("ColorId"),
                j => j
                    .HasOne<Customer>()
                    .WithMany()
                    .HasForeignKey("CustomerId"));
Comment

PREVIOUS NEXT
Code Example
Csharp :: show datatable c# 
Csharp :: c# string across multiple lines 
Csharp :: unity save scene at runtime 
Csharp :: sql server query output to json file automatically 
Csharp :: c# check if character is lowercase 
Csharp :: unity screen size fix 
Csharp :: how to empty an array c# 
Csharp :: HttpClient .net Core add Certificate 
Csharp :: datetimeoffset to datetime 
Csharp :: c# return values 
Csharp :: how to stop a coroutine unity c# 
Csharp :: datetime show 24 hour format c# 
Csharp :: math in c# 
Csharp :: .net using appsettings variables 
Csharp :: c# code snippets 
Csharp :: c# get enum name from value 
Csharp :: Entity framwork update parent entity added new sub entity 
Csharp :: vb.net read registry key as string 
Csharp :: f sharp global variable 
Csharp :: c# create default instance of type 
Csharp :: populate array from an XML file 
Csharp :: Null check operator used on a null value 
Csharp :: how to hide tree level button when no record found for devexpress child grid view in Winform c# 
Csharp :: Set orientation of moving object towards it movement direction without using rigidbody 
Csharp :: Handlebars c# datetime now 
Csharp :: c# get error message from cmd command 
Csharp :: c# entity framework order by array 
Csharp :: fetch post .net 
Csharp :: best unity regex for email validation in c# 
Csharp :: c# order of initialization 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =