EF序列包含多个元素

问题描述

我们有采用EF方法的MVC项目。 当我们要添加迁移时出现此错误

system.invalidOperationException:序列包含多个元素 在System.Linq.Enumerable.SingleOrDefault [TSource](IEnumerable 1 source) at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.<>c__displayClass76_1.<FindRenamedindexes>b__5(String c) at System.Linq.Enumerable.WhereSelectListIterator 2.MoveNext() 在System.Linq.Enumerable.SequenceEqual [TSource]处(IEnumerable 1 first,IEnumerable 1秒,IEqualityComparer 1 comparer) at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.<>c__displayClass76_0.<FindRenamedindexes>b__3(<>f__AnonymousType40 2 h__TransparentIdentifier1) 在System.Linq.Enumerable.WhereSelectEnumerableIterator 2.MoveNext() at System.Collections.Generic.List 1..ctor(IEnumerable 1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable 1来源)处 在System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.Diff中(ModelMetadata源,ModelMetadata目标,Lazy 1 modificationCommandTreeGenerator,MigrationsqlGenerator migrationsqlGenerator,String sourceModelVersion,String targetModelVersion) at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.Diff(XDocument sourceModel,XDocument targetModel,Lazy 1修改CommandTreeGenerator,MigrationsqlGenerator migrationsqlGenerator,String sourceModelVersion,String targetModelVersion) 在System.Data.Entity.Migrations.DbMigrator.Scaffold处(字符串migrationName,字符串名称空间,布尔值ignoreChanges) 在System.Data.Entity.Infrastructure.Design.Executor.ScaffoldInternal(字符串名称,DbConnectionInfo connectionInfo,字符串migrationsConfigurationName,布尔值ignoreChanges) 在System.Data.Entity.Infrastructure.Design.Executor.Scaffold。 c__displayClass0_0。 b__0() 在System.Data.Entity.Infrastructure.Design.Executor.OperationBase。 c__displayClass4_0`1.b__0() 在System.Data.Entity.Infrastructure.Design.Executor.OperationBase.Execute(动作) 序列包含多个元素

**我们为某些型号更改了一些键名,我不知道它是否相关

,我们发现没有任何解决方案可用于EF方法, 那么该错误的可能解决方案是什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)