在VS 2010中,<MvcBuildViews>true</MvcBuildViews>
如果使用Entity Framework ,更改MVC2项目的.csproj文件会导致错误.
无法加载类型'System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider'.C:\ Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config 129
我想在调试时构建视图,我也希望我的项目能够编译!
VS 2017的全新"Go to All"(Ctrl + T或Ctrl +,)不会为我列出项目.
搜索了它的设置,没有运气.也没有关于此的错误消息.有任何想法吗?
谢谢.
您将如何在ASP.NET Webforms 4.0路由中完成这些任务;
谢谢.
我正在运行时构建/更新EntityFramework EntityObject.我想设置实体类的属性,属性名称和值来自另一个源.
所以我这样做;
public static EntityCollection<T> UpdateLocaleEntity<T>(EntityCollection<T> entityCollectionToUpdate, params ILocaleControl[] values) where T : EntityObject
{
foreach (var x in entityCollectionToUpdate)
{
Type t = typeof(T);
dynamic localeEntity = x;
string cultureCode = localeEntity.CultureCode;
for (int j = 0; j < values.Length; j++)
{
var value = values[j].GetLocaleValue(cultureCode);
t.GetProperty(values[j].EntityPropertyName).SetValue(localeEntity, value, null);
}
}
return entityCollectionToUpdate;
}
Run Code Online (Sandbox Code Playgroud)
那么,我怎样才能摆脱"t.GetProperty(values [j] .EntityPropertyName).SetValue(localeEntity,value,null);" 部分,是否有一种动态的方式来做到这一点?
就像是;
dynamicCastedLocaleEntity.GetProperty(values[j].EntityPropertyName) = value;
Thanks.
asp.net ×2
asp.net-mvc ×1
c#-4.0 ×1
csproj ×1
dynamic ×1
ide ×1
reflection ×1
routing ×1
search ×1
webforms ×1