ObjectContext コンストラクター (String)
[このページは、Entity Framework 6 に関するページです。最新バージョンは、'Entity Framework' NuGet パッケージとして入手できます。Entity Framework の詳細については、msdn.com/data/ef を参照してください。]
指定された接続文字列および既定のエンティティ コンテナー名を使用して、ObjectContext クラスの新しいインスタンスを初期化します。
名前空間: System.Data.Entity.Core.Objects
アセンブリ: EntityFramework (EntityFramework.dll 内)
構文
'宣言
<SuppressMessageAttribute("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope", Justification := "Object is in fact passed to property of the class and gets Disposed properly in the Dispose() method.")> _
Public Sub New ( _
connectionString As String _
)
'使用
Dim connectionString As String
Dim instance As New ObjectContext(connectionString)
[SuppressMessageAttribute("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope", Justification = "Object is in fact passed to property of the class and gets Disposed properly in the Dispose() method.")]
public ObjectContext(
string connectionString
)
[SuppressMessageAttribute(L"Microsoft.Reliability", L"CA2000:DisposeObjectsBeforeLosingScope", Justification = L"Object is in fact passed to property of the class and gets Disposed properly in the Dispose() method.")]
public:
ObjectContext(
String^ connectionString
)
[<SuppressMessageAttribute("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope", Justification = "Object is in fact passed to property of the class and gets Disposed properly in the Dispose() method.")>]
new :
connectionString:string -> ObjectContext
public function ObjectContext(
connectionString : String
)
パラメーター
- connectionString
型 : System.String
メタデータ情報へのアクセスも可能にする接続文字列。
例外
例外 | 状態 |
---|---|
ArgumentNullException | connectionString が null です。 |
ArgumentException | connectionString が無効であるか、メタデータ ワークスペースが無効です。 |