This project is read-only.

EFDAL Metadata String Syntax

Dec 20, 2010 at 5:34 PM

I am struggling to get an EFDAL WPF application to work, and could use some help on the proper syntax for metadata EntityContext strings.

To minimize problems I'm using EntityConnectionStringBuilder and SqlConnectionStringBuilder:

SqlConnectionStringBuilder sqlBuilder = new SqlConnectionStringBuilder();
sqlBuilder.DataSource = "Galactica";
sqlBuilder.InitialCatalog = "OlbertFamilyMedia";
sqlBuilder.IntegratedSecurity = true;
sqlBuilder.MultipleActiveResultSets = true;
sqlBuilder.Pooling = false;

EntityConnectionStringBuilder entityBuilder = new EntityConnectionStringBuilder();
entityBuilder.Provider = "System.Data.SqlClient";
entityBuilder.ProviderConnectionString = sqlBuilder.ToString();
entityBuilder.Metadata = @"res://Olbert.OFMEditor.EFDAL, Version=, Culture=neutral, PublicKeyToken=null/OFMEditor.csdl|res://Olbert.OFMEditor.EFDAL, Version=, Culture=neutral, PublicKeyToken=null/OFMEditor.ssdl|res://Olbert.OFMEditor.EFDAL, Version=, Culture=neutral, PublicKeyToken=null/OFMEditor.msl";

Unfortunately, when I try to create the EntityContext an exception is thrown complaining that the specified resource cannot be found.

I've checked the assembly info for Olbert.OFMEditor.EFDAL and the version, culture and publickeytoken info appears to match what I specified in the string.


- Mark

Dec 20, 2010 at 5:52 PM

Some additional info: if I put the connection string definition into the app.config file, and use the default context constructor, everything works as expected.

So there's apparently a problem with using EntityConnectionStringBuilder.

- Mark