Entity Framework Code First Repository really generic and problems with two context?

That is common problem. You cannot pass entity loaded from one context to another context. You should share context among your repositories when working in one unit of work (logical transaction).

It is also enough to use one repository instance per type in the unit of work.

You need to share the EF db context between your repositories. When you retrieve data from the database via EF, the object that gets returned by EF is attached to a specific instance of a db context for change tracking. If you attempt to perform any operations on that entity in another database context, EF will throw an exception as the database context can see it's already attached to another context.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions