开发者

DomainService only works with EDMX file?

I want to add a new domain service class within vs2010. I choose my entity framework database context in the dialog "Add New Domain Service Class", but it doesen't show me the available entities. If I click "ok" VS2010 gives me the following error message:

---------------------------
Microsoft Visual Studio
---------------------------
Value cannot be null.

Parameter name: ssdlPath
---------------------------
OK   
---------------------------

The reason for this is, that I don't have an EDMX file (I tried it with an EDMX file and it worked). Instead I have a seperate csdl, msl and ssdl file. This is because I want to support multiple databases.

How can I use the class LinqToEntitiesDomainService with my data context? The entity objects and the data context are generated with the POCO template. If I add the Domain Serive class manually (not using the domain service wizzard) I get a compile time error which says basically the same:

MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(303,5): error : Value cannot be null.
MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(303,5): error : Parameter name: ssdlP开发者_StackOverflowath

Can anyone help?


Select YorDoaminContainer.csdl,YorDoaminContainer.ssdl file and the YorDoaminContainer.msl file and then In Properties, set Build Action to Embedded Resource. And then make sure you have correct connection string for this three resources.

for example:

<connectionStrings>
    <add name="DomainModel" 
         connectionString="metadata=res://*/NameSpace.DomainController.csdl|res://*/NameSpace.DomainController.ssdl|res://*/NameSpace.DomainController.msl;
         provider=System.Data.SqlClient;provider connection string='Data Source=localhost;
         Initial Catalog=DB;Integrated Security=True;Connection Timeout=60;
         providerName="System.Data.EntityClient" />
</connectionStrings>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜