I am using entity framework code first and mapping our unidata files to tables to get data. I am wanting to join the tables or use navigation properties. The 2 tables share a common field called WorkInProgressOperationId. I have tried using join and navigation properties but it does not seem to work when mapping to unidata files.Is this possible?
public class WorkInProgressMapping : EntityTypeConfiguration<WorkInProgress>
{
public WorkInProgressMapping()
{
this.ToTable("WIPMASTER");
this.HasKey(e => e.WorkInProgressId).Ignore(e => e.EntityId);
this.Property(e => e.WorkInProgressId).HasColumnName("@ID");
this.Property(e => e.SequenceNumber).HasColumnName("OPER_SEQ_NBR");
this.Property(e => e.WorkOrderNumber).HasColumnName("WORK_ORDER");
this.Property(e => e.StartQuantity).HasColumnName("SCHED_COMP_QTY");
this.Property(e => e.JobNumber).HasColumnName("JOB_NBR");
this.Property(e => e.JobDetailId).HasColumnName("JOBDET_ID");
this.Property(e => e.ComputerGeneratedNumber).HasColumnName("CPN");
this.Property(e => e.ItemNumber).HasColumnName("ITEM_NBR");
this.Property(e => e.ParentWorkOrder).HasColumnName("PARENT_WO");
this.Property(e => e.ParentDueDate).HasColumnName("SCHED_COMP_DATE");
this.Property(e => e.WorkOrderIssueDate).HasColumnName("RELEASE_DATE");
this.Property(e => e.WorkInProgressOperationId).HasColumnName("WIPOPERACT_ID");
}
}
public class WorkInProgressOperationMapping : EntityTypeConfiguration<WorkInProgressOperation>
{
public WorkInProgressOperationMapping()
{
this.ToTable("WIPOPER");
this.HasKey(e => e.WorkInProgressOperationId).Ignore(e => e.EntityId);
this.Property(e => e.WorkInProgressOperationId).HasColumnName("@ID");
this.Property(e => e.OperationNumber).HasColumnName("OPERATION_NBR");
this.Property(e => e.OperationSequence).HasColumnName("OPER_SEQ");
this.Property(e => e.WorkOrder).HasColumnName("WORK_ORDER");
this.Property(e => e.NextSequence).HasColumnName("NEXT_SEQ");
this.Property(e => e.Status).HasColumnName("OPER_STATUS");
this.Property(e => e.QuantityComplete).HasColumnName("QTY_COMPLETE");
this.Property(e => e.SalesOrderDeliveryDate).HasColumnName("DUE_SO");
this.Property(e => e.WorkOrderDeliveryDate).HasColumnName("WO_DUE");
this.Property(e => e.StartingQuantity).HasColumnName("EXP_START_QTY");
}
}
Another Example : One to Many Relation (U2 Tables/Files)