Here's the situation. I have two table (Table 1 and Table 2) with the same entities and a class(ClassA) which was mapped to Table 1 but in some scenario I have to transfer the specific data from Table 1 to Table 2. How can I map the two table (Table 1 and Table 2) to ClassA using Entity Framework Code First?
Even though you're using Code First, it's important to remember that your C# entities are projections of your database at runtime. If you use schema generation, your database schema is a projection of your C# entity metadata.
That means the safest mapping is one-to-one. If you can live without schema generation, you can get away with multiple entities mapped to a database object. Conceptually, you can never get away with one entity mapped to multiple database objects. Sure, you might be able to temporarily do it by completely subverting the EF plumbing, but at that point you're not truly mapped in any meaningful sense. Why not step outside the EF world to do whatever needs doing and step back in when you're finished? Either that or modify your model slightly to accommodate EF's expectations.