【发布时间】:2016-10-14 12:43:52
【问题描述】:
我有一个使用 DAL dll 的 Azure Function 系统。此 dll 使用实体框架连接到 SQL 数据库,并且是我们的数据库优先代码的 UnitOfWork 格式。
在 azure 函数中,没有标准的“app.config”文件可以用我的数据库连接字符串进行更新。所以我在应用程序设置的 GUI 中添加了它:
我已经从 app.config 复制了代码,只需从配置中获取值,转换 " 值,然后将其粘贴到 GUI 中。
<add name="Entities" connectionString="<This is what I copied>" providerName="System.Data.EntityClient" />
但是,每当我运行代码时,我都会收到此错误:
2016-10-14T12:39:44.248 C# ServiceBus queue trigger function processed message: test
2016-10-14T12:39:44.265 Getting UnitOfWork
2016-10-14T12:39:44.607 Getting Repository
2016-10-14T12:39:44.639 ERROR The connection string 'Entities' in the application's configuration file does not contain the required providerName attribute."
因此,通常提供者名称是实体框架,但我不知道如何将其包含在代码中。我的问题是,我如何连接这个连接字符串,并有一个实体框架提供者?
【问题讨论】:
-
您是否设法在没有基于代码的配置的情况下使其正常工作?
标签: c# entity-framework azure azure-functions