Is it possible to have ModelBuilders for Entities to be in different files? We are trying to separate automatic scaffolding from database, and have certain manual customization also.
This is what I am attempting, receiving error below,
File 1:
modelBuilder.Entity<PropertyMailingAddress>(entity =>
{
entity.HasOne(d => d.LkAddressType)
.WithMany(p => p.PropertyMailingAddress)
.HasForeignKey(d => d.LkAddressTypeId)
.HasConstraintName("FK_PropertyMailingAddress_LK_AddressTypeId");
File 2:
modelBuilder.Entity<PropertyMailingAddress>(entity =>
{
entity.HasOne(d => d.LkSourceOfAddress)
.WithMany(p => p.PropertyMailingAddress)
.HasForeignKey(d => d.LkSourceOfAddressId)
.HasConstraintName("FK_PropertyMailingAddress_LK_SourceOfAddressId");
Error CS1501 No overload for method 'Entity' takes 2 arguments
Is it possible to have partial class methodology for this?