I have the following Requirement
I have a Table and corresponding entity in EF. Now my code is inserting Images to DB in the following table.
PatientChartImages(
PatientChartImageId guid,
PatientChartId guid,
NoOfImages int,
PatientChartImage varBinary(Max)
)
I have to create a seperate table and store Images in it ins开发者_运维技巧tead of PatientChartImages Table .
PatientChartImagesSource(
PatientChartImageId,
PatientChartImage varBinary(Max)
)
Is there a way in EntityFramework, So that whenever i refer to PatientChartImage of PatientChartImages,PatientChartImage of PatientChartImagesSource is referred. This way i won't have to change my DAL. please suggest.
Yes there is a way. This scenario is called Entity splitting. You must create one-to-one relation on primary keys between PatientChartImages and PatientChartImagesSource to use it.
精彩评论