I am using EF4 and I have two objects that I want to map to the same POCO . I am not sure how I can do this.
Entity 1 -> Foo (this represents the table FOO in db)
POCO → Foo
Entity 2 -> FooView (this is the FooView view in db)
POCO → Foo
I understand that I need to do something like
IObjectSet<Foo> _foos = CreateObjectSet<Foo>(); // Note spelling of the Entity. IObjectSet<Foo> _foosView = CreateObjectSet<Foo>("FooViews");
But when I try to do this, it compiles, but it fails with the following exception:
System.ArgumentException: System.ArgumentException: The specified object type, "MyProject.Core.Foo", does not match the type "EntityFramework.SqlServerModel.FoosView" from EntitySet 'FoosViews'.
Any suggestions?
source share