{"action":"closed","issue":{"url":"https://api.github.com/repos/voronov-maxim/OdataToEntity/issues/16","repository_url":"https://api.github.com/repos/voronov-maxim/OdataToEntity","labels_url":"https://api.github.com/repos/voronov-maxim/OdataToEntity/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/voronov-maxim/OdataToEntity/issues/16/comments","events_url":"https://api.github.com/repos/voronov-maxim/OdataToEntity/issues/16/events","html_url":"https://github.com/voronov-maxim/OdataToEntity/issues/16","id":328799179,"node_id":"MDU6SXNzdWUzMjg3OTkxNzk=","number":16,"title":"\"Object reference not set to an instance of an object\" within OeEfCoreEdmModelMetadataProvider.GetForeignKey","user":{"login":"techniq","id":177476,"node_id":"MDQ6VXNlcjE3NzQ3Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/177476?v=4","gravatar_id":"","url":"https://api.github.com/users/techniq","html_url":"https://github.com/techniq","followers_url":"https://api.github.com/users/techniq/followers","following_url":"https://api.github.com/users/techniq/following{/other_user}","gists_url":"https://api.github.com/users/techniq/gists{/gist_id}","starred_url":"https://api.github.com/users/techniq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techniq/subscriptions","organizations_url":"https://api.github.com/users/techniq/orgs","repos_url":"https://api.github.com/users/techniq/repos","events_url":"https://api.github.com/users/techniq/events{/privacy}","received_events_url":"https://api.github.com/users/techniq/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-06-03T04:47:59Z","updated_at":"2018-07-02T18:16:01Z","closed_at":"2018-07-02T18:16:01Z","author_association":"NONE","body":"I'm attempting to migrate from `Microsoft.AspNetCore.OData` to `OdataToEntity` but I'm receiving the following exception during `dataAdapter.BuildEdmModelFromEfCoreModel()` witihin [OeEfCoreEdmModelMetadataProvider.GetForeignKey()](https://github.com/voronov-maxim/OdataToEntity/blob/fe119ab5c674856d3ea5711312912753d3d8ea2e/source/OdataToEntity.EfCore/OeEfCoreEdmModelMetadataProvider.cs#L31) when I added my relatively complex DbContext/Models (same one I'm currently using with `Microsoft.AspNetCore.OData`)\r\n\r\n```\r\nSystem.NullReferenceException: \"Object reference not set to an instance of an object.\"\r\n  at OdataToEntity.EfCore.OeEfCoreEdmModelMetadataProvider.GetForeignKey(PropertyInfo propertyInfo)\r\n   at OdataToEntity.ModelBuilder.FKeyInfo.GetDependentStructuralProperties(OeEdmModelMetadataProvider metadataProvider, EntityTypeInfo dependentInfo, PropertyInfo dependentProperty)\r\n   at OdataToEntity.ModelBuilder.FKeyInfo.Create(OeEdmModelMetadataProvider metadataProvider, Dictionary`2 entityTypes, EntityTypeInfo dependentInfo, PropertyInfo dependentNavigationProperty)\r\n   at OdataToEntity.ModelBuilder.EntityTypeInfo.BuildProperty(Dictionary`2 entityTypes, Dictionary`2 enumTypes, Dictionary`2 complexTypes, PropertyInfo clrProperty)\r\n   at OdataToEntity.ModelBuilder.EntityTypeInfo.BuildProperties(Dictionary`2 entityTypes, Dictionary`2 enumTypes, Dictionary`2 complexTypes)\r\n   at OdataToEntity.ModelBuilder.OeEdmModelBuilder.BuildEdmModel()\r\n   at OdataToEntity.EfCore.OeEfCoreDataAdapterExtension.BuildEdmModelFromEfCoreModel(OeDataAdapter dataAdapter)\r\n   at OdataToEntityTest.Startup.ConfigureServices(IServiceCollection services) in /Users/techniq/Documents/Development/playground/odata-to-entity/OdataToEntityTest/Startup.cs:line 34\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()\r\n   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()\r\n   at OdataToEntityTest.Program.BuildWebHost(String[] args) in /Users/techniq/Documents/Development/playground/odata-to-entity/OdataToEntityTest/Program.cs:line 21\r\n   at OdataToEntityTest.Program.Main(String[] args) in /Users/techniq/Documents/Development/playground/odata-to-entity/OdataToEntityTest/Program.cs:17\r\n```"}}
{"actor":{"display_login":"voronov-maxim"}}