1

Closed

Not working in EF 6

description

Hi Fabrice,

First of all, thanks very much for your effort creating this library. I have been using it for quite a while, it is very reliable and easy to use and does exactly as it says on the tin.

I have recently updated my project to MVC 5 and entity framework 6, and the library stopped working. This is possible due to come changes in EF library. I did even try to download the source code and update the EF version but unfortunately I cannot get it working.

There was a problems when executing the following line of code:

public static class DbContextExtensions
{
    public static ObjectContext GetObjectContext(this DbContext dbContext)
    {
        return (dbContext.GetObjectContext());
    }
}
Note that I have updated the code to make it compile.

Do you have any plans to update this library to support latest version of Entity framework?

Thanks again,

Yong
Closed Nov 18, 2013 at 8:14 AM by Fab_Michellonet
Library updated.

comments

Fab_Michellonet wrote Nov 18, 2013 at 8:12 AM

Hi Yong,

thanks for using my this lib.

I've recently updated EntityFramework.Patterns to support EF 6.
You should be able to update via nuget;

yong_wang wrote Nov 18, 2013 at 1:01 PM

Hi Fabrice,

Thanks very much for your hard work. I am trying use your library with structuremap IoC container and have problems resolving the DbContextAdapter. I have read your documentation on Unity IoC but failed to transfer the following line of code to Structuremap.

Can you shield some light on working with Structuremap IoC container please?


UnityContainer.RegisterInstance(new DbContextAdapter(UnityContainer.Resolve<DbContext>()), new ContainerControlledLifetimeManager());
        UnityContainer.RegisterType<IObjectSetFactory>(
            new InjectionFactory(con => con.Resolve<DbContextAdapter>())
            );

        UnityContainer.RegisterType<IObjectContext>(
            new InjectionFactory(con => con.Resolve<DbContextAdapter>())
            );

Thanks again,
Yong