Я пытаюсь обновить свое решение с CTP-версии EF Code First от июня 2011 года до бета-версии EF 5.
У меня возникла следующая проблема:
После создания экземпляра контекста, Я получаю исключение, перечисленное ниже, когда пытаюсь запросить контекст.
Кажется, что между двумя версиями EF что-то изменилось, и теперь у него возникают проблемы с настройкой, но яв затруднении с точки зрения того, с чего начать.
Большое спасибо заранее за любую помощь.
Пол.
System.InvalidOperationException не было обработано кодом пользователя
HResult = -2146233079 Сообщение = последовательность содержит более одного элемента. Source = System.Core StackTrace: at System.Linq.Enumerable.SingleOrDefault [TSource] (IEnumerable 1 source)
at System.Data.Entity.ModelConfiguration.Configuration.Properties.Navigation.NavigationPropertyConfiguration.Configure(DbDatabaseMapping
databaseMapping)
at System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.<>c__DisplayClass36.<ConfigureAssociationMappings>b__35(NavigationPropertyConfiguration c)
at System.Data.Entity.ModelConfiguration.Utilities.IEnumerableExtensions.Each[T](IEnumerable
1 ts, действие 1 action)
at System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.ConfigureAssociationMappings(DbDatabaseMapping
databaseMapping)
at System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.Configure(EdmEntityType
entityType, DbDatabaseMapping databaseMapping, DbProviderManifest
providerManifest)
at System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration.ConfigureEntityTypes(DbDatabaseMapping
databaseMapping, DbProviderManifest providerManifest)
at System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration.Configure(DbDatabaseMapping
databaseMapping, DbProviderManifest providerManifest)
at System.Data.Entity.DbModelBuilder.Build(DbProviderManifest providerManifest, DbProviderInfo providerInfo)
at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext
internalContext)
at System.Data.Entity.Internal.RetryLazy
2.GetValue (TInputвход) в System.Data.Entity.Internal.LazyInternalContext.InitializeContext () в System.Data.Entity.Internal.InternalContext.Initialize () в System.Data.Entity.Internal.InternalContext.ForceOSpaceLoadingForKnownEntityTypes () в System.Data.Entity.DbContext.System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext () в AccessAccounts.Accounts.DataAccess.Context.ActorountsContringEnterpriseVS11 \ Enterprise \ Access Access EF \ Context \ AccountsContext.cs: строка 77 в AccessAccounts.BusinessService.Logon.LogonService.CheckDatabaseCompatibility () в c: \ Source \ EnterpriseVS11 \ Enterprise \ Бизнес-службы \ src \ AccessAccounts \ BusinessService \ Logon \ LogonService.cs: строка 119 в AccessAccounts.BusinessService.Logon.LogonService.Logon (ApplicationTypes applicationType, String databaseName, String userName, String password, AuthenticationType authenticationMode) в каталоге c: \ Source \ EnterpriseVS11 \ Enterprise \ Business Service \ src \ AccessAccounts \ BusinessServiceLogon \ LogonService.cs: строка 255 в SyncInvokeLogon (Object, Object [], Object []) в System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke (экземпляр объекта, входы Object [],Object [] & output) в System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin (MessageRpc & rpc) InnerException: