Entity Connection String Constructor not found in EF 5 and WCF 4.5 at runtime

不羁岁月 提交于 2019-12-07 00:28:28

Add the constructor you are looking for in a partial class outside of the auto-generated entity class:

public partial class WMSChennaiDEVEntities : DbContext
{
    public WMSChennaiDEVEntities(string connectionstring)
            : base(connectionstring)
    {
    }
}

This constructor is not included in EF 5 apparently to prevent us from accidentally passing a sql connection string when an entity connection string is desired. Don’t use Code First by mistake

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!