{"action":"created","issue":{"url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/240","repository_url":"https://api.github.com/repos/simpleinjector/SimpleInjector","labels_url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/240/labels{/name}","comments_url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/240/comments","events_url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/240/events","html_url":"https://github.com/simpleinjector/SimpleInjector/issues/240","id":156449782,"number":240,"title":"The entity type xxx is not part of the model for the current context","user":{"login":"Nesse","id":2901978,"avatar_url":"https://avatars.githubusercontent.com/u/2901978?v=3","gravatar_id":"","url":"https://api.github.com/users/Nesse","html_url":"https://github.com/Nesse","followers_url":"https://api.github.com/users/Nesse/followers","following_url":"https://api.github.com/users/Nesse/following{/other_user}","gists_url":"https://api.github.com/users/Nesse/gists{/gist_id}","starred_url":"https://api.github.com/users/Nesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nesse/subscriptions","organizations_url":"https://api.github.com/users/Nesse/orgs","repos_url":"https://api.github.com/users/Nesse/repos","events_url":"https://api.github.com/users/Nesse/events{/privacy}","received_events_url":"https://api.github.com/users/Nesse/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-05-24T08:35:56Z","updated_at":"2016-05-24T09:12:01Z","closed_at":null,"body":"I've build a web application that works with Simple Injector (2.8.3) and SharpRepository (1.4.6). Everything worked fine until I've updated my nuget packages. Does anyone know what went wrong?\r\n\r\n```xml\r\n<package id=\"SharpRepository.EfRepository\" version=\"1.4.7.2\" targetFramework=\"net46\" />\r\n<package id=\"SharpRepository.Ioc.SimpleInjector\" version=\"1.4.6.0\" targetFramework=\"net451\" />\r\n<package id=\"SharpRepository.Repository\" version=\"1.4.7.2\" targetFramework=\"net46\" />\r\n<package id=\"SimpleInjector\" version=\"3.1.5\" targetFramework=\"net46\" />\r\n<package id=\"SimpleInjector.Extensions.ExecutionContextScoping\" version=\"3.1.5\" targetFramework=\"net46\" />\r\n<package id=\"SimpleInjector.Extensions.LifetimeScoping\" version=\"3.1.5\" targetFramework=\"net46\" />\r\n<package id=\"SimpleInjector.Integration.Web\" version=\"3.1.5\" targetFramework=\"net46\" />\r\n<package id=\"SimpleInjector.Integration.WebApi\" version=\"3.1.5\" targetFramework=\"net46\" />\r\n<package id=\"SimpleInjector.Packaging\" version=\"3.1.5\" targetFramework=\"net46\" />\r\n```\r\n\r\nThis is the error I'm getting:\r\n```\r\n{\r\nMessage: \"An error has occurred.\",\r\nExceptionMessage: \"The entity type WarehouseLocation is not part of the model for the current context.\",\r\nExceptionType: \"System.InvalidOperationException\",\r\nStackTrace: \" bij System.Data.Entity.Internal.InternalContext.UpdateEntitySetMappingsForType(Type entityType) bij System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) bij System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() bij System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() bij System.Data.Entity.Internal.Linq.InternalSet`1.Find(Object[] keyValues) bij System.Data.Entity.DbSet`1.Find(Object[] keyValues) bij SharpRepository.EfRepository.EfRepositoryBase`2.GetQuery(TKey key, IFetchStrategy`1 fetchStrategy) bij SharpRepository.Repository.RepositoryBase`2.<>c__DisplayClass20.<Get>b__1c() bij SharpRepository.Repository.Queries.QueryManager`2.ExecuteGet(Func`1 query, TKey key) bij SharpRepository.Repository.RepositoryBase`2.Get(TKey key, IFetchStrategy`1 fetchStrategy) bij SharpRepository.Repository.RepositoryBase`2.Get(TKey key) bij Erp.Service.Warehouse.WarehouseService.GetWarehouseLocationById(Int32 id) in C:\\Users\\wesley\\Documents\\## Bitbucket\\ERP\\intershoe\\Erp.Service\\Warehouse\\WarehouseService.cs:regel 342 bij Erp.Web.Api.Controllers.WarehouseController.Test() in C:\\Users\\wesley\\Documents\\## Bitbucket\\ERP\\intershoe\\Erp.Web.Api\\Controllers\\WarehouseController.cs:regel 396 bij lambda_method(Closure , Object , Object[] ) bij System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters) bij System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments) bij System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) --- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden --- bij System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bij System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext() --- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden --- bij System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bij System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() --- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden --- bij System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bij System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\"\r\n}\r\n```\r\n\r\nAnd this is the code I wrote to use DI in my Web Api Application:\r\n```c#\r\npublic static class SimpleInjectorWebApiInitializer\r\n{\r\n    public static void Initialize()\r\n    {      \r\n        var container = new Container();\r\n        container.Options.DefaultScopedLifestyle = new WebApiRequestLifestyle();\r\n\r\n        InitComponents(container);\r\n\r\n        container.RegisterWebApiControllers(HttpGlobalConfiguration.Configuration);\r\n        container.Verify();\r\n\r\n        // hangfire\r\n        var simpleInjectorJobActivator = new SimpleInjectorJobActivator(container); \r\n        HangfireGlobalConfiguration.Configuration.UseActivator(simpleInjectorJobActivator);\r\n            \r\n        // web api\r\n        HttpGlobalConfiguration.Configuration.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(container);\r\n\r\n    }\r\n\r\n    private static void InitComponents(Container container)\r\n    {\r\n        // context\r\n        container.Register<DbContext, ErpContext>(Lifestyle.Scoped);\r\n\r\n        // hangfire jobs\r\n        container.Register<QuoteJob>();\r\n\r\n        // repositories\r\n        container.RegisterSharpRepository();\r\n\r\n        // services\r\n        container.Register<ICategoryService, CategoryService>();\r\n        container.Register<IManufacturerService, ManufacturerService>();\r\n        container.Register<IProductService, ProductService>();\r\n        container.Register<IProductAttributeService, ProductAttributeService>();\r\n        .......       \r\n\r\n    }    \r\n\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/comments/221211034","html_url":"https://github.com/simpleinjector/SimpleInjector/issues/240#issuecomment-221211034","issue_url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/240","id":221211034,"user":{"login":"Nesse","id":2901978,"avatar_url":"https://avatars.githubusercontent.com/u/2901978?v=3","gravatar_id":"","url":"https://api.github.com/users/Nesse","html_url":"https://github.com/Nesse","followers_url":"https://api.github.com/users/Nesse/followers","following_url":"https://api.github.com/users/Nesse/following{/other_user}","gists_url":"https://api.github.com/users/Nesse/gists{/gist_id}","starred_url":"https://api.github.com/users/Nesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nesse/subscriptions","organizations_url":"https://api.github.com/users/Nesse/orgs","repos_url":"https://api.github.com/users/Nesse/repos","events_url":"https://api.github.com/users/Nesse/events{/privacy}","received_events_url":"https://api.github.com/users/Nesse/received_events","type":"User","site_admin":false},"created_at":"2016-05-24T09:12:01Z","updated_at":"2016-05-24T09:12:01Z","body":"Could I be that the ***SharpRepository.Ioc.SimpleInjector*** is outdated when using the latest updates?"}}
{"actor":{"display_login":"Nesse"}}