基本上我想使用动态数据网站来维护 EF4 模型中的数据,其中实体位于它们自己的程序集中。模型和上下文在另一个程序集中。
我试过这个Entity Framework 4 + Self-Tracking Entities + ASP.NET Dynamic Data = Error
但从反射中得到一个“模糊匹配”错误:
System.Reflection.AmbiguousMatchException 未被用户代码 Message=Ambiguous match found 处理。Source=mscorlib StackTrace:在 System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) at System.Type.GetProperty(String name) at System.Web.DynamicData .ModelProviders.EFTableProvider..ctor(EFDataModelProvider dataModel, EntitySet entitySet, EntityType entityType, Type entityClrType, Type parentEntityClrType, Type rootEntityClrType, String name) 在 System.Web.DynamicData.ModelProviders.EFDataModelProvider.CreateTableProvider(EntitySet entitySet, EntityType entityType) 在 System .Web.DynamicData.ModelProviders.EFDataModelProvider..ctor(对象上下文实例,Func1 contextFactory)
at System.Web.DynamicData.ModelProviders.SchemaCreator.CreateDataModel(Object contextInstance, Func
1 contextFactory) 在 System.Web.DynamicData.MetaModel.RegisterContext(Func`1 contextFactory, ContextConfiguration configuration) 在 C:\dev\Puffin\Puffin.Prototype.Web\Global.asax 中的 WebApplication1.Global.RegisterRoutes(RouteCollection routes)。 c:\dev\Puffin\Puffin.Prototype.Web\Global.asax.cs 中 WebApplication1.Global.Application_Start(Object sender, EventArgs e) 的第 42 行:第 78 行 InnerException: