简体   繁体   English

数据库名称和RIA服务

[英]Database name and RIA Services

Is it possible to get the database name within a DomainService of the RIA Services? 是否可以在RIA Services的DomainService中获取数据库名称

ie I have got 即我有

public partial class MyAppDomainService : LinqToEntitiesDomainService<MyAppEntities>

This line this.ObjectContext.Connection.Database doesn't has any appropriated information. 这行this.ObjectContext.Connection.Database没有任何适当的信息。

How do I can get it? 我如何得到它?

Linq to Entities uses a conceptual model between the actual data source connection. Linq to Entities在实际数据源连接之间使用概念模型。 What you are looking for is: 您正在寻找的是:

((System.Data.EntityClient.EntityConnection)this.ObjectContext.Connection).StoreConnection.Database

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM