-
Entity Framework with Spring.NET
I have a problem with connectionString of Entity Framework with Spring.NET
How delcare connectionsString and providerName from Entity FrameWork to Spring.NET?
The browser said: Not declared attribute 'providerName'.
My App.config is this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="DietDBEntities" connectionString="metadata=res://*/XXXDataModel.csdl|res://*/XXXDataModel.ssdl|res://*/XXXDataModel.msl;provider=System.Data.SqlClient;pr ovider connection string="data source=XXX\XXX;initial catalog=XXXDB;user id=XXX;password=XXX;multipleactiveresultsets=True; App=EntityFramework""
providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>
My DAO.xml is this:
<objects xmlns="http://www.springframework.net" xmlns:db="http://www.springframework.net/database" >
<db:provider id="XXXDBEntities"
provider="System.Data.SqlClient"
connectionString="metadata=res://*/XXXDataModel.csdl|res://*/XXXDataModel.ssdl|res://*/XXXDataModel.msl;provider=System.Data.SqlClient;pr ovider connection string="data source=XXX\XXX;initial catalog=XXXDB;user id=XXX;password=XXX;multipleactiveresultsets=True; App=EntityFramework""
providerName="System.Data.EntityClient" />
<object id="adoTemplate" type="Spring.Data.Core.AdoTemplate, Spring.Data">
<property name="DbProvider" ref="XXXDBEntities"/>
</object>
<object id="ExampleDAO" type="XXX.DAO.ExampleDAO, XXX.DAO">
</object>
</objects>
My XXXModel.Context is this:
namespace XXX.DAO
{
public partial class XXXDBEntities : ObjectContext
{
public const string ConnectionString = "name=XXXDBEntities";
public const string ContainerName = "XXXDBEntities";
#region Constructors
public XXXDBEntities()
: base(ConnectionString, ContainerName) //If not providerName ArgumentException:The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
{
Initialize();
}
//Another code here...
}
}
I'm using .NET 4.0 and Spring 1.3.2
All my IoC is build with Spring.NET
-
SPRNET's data access (DAO) infrastructure doesn't support EntityFramework at this time so there isn't any known resolution to this issue for you.
-Steve B.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules