forked from kenjiuno/Npgsql
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathNpgsqlDatabaseExtensions.cs
More file actions
30 lines (24 loc) · 881 Bytes
/
NpgsqlDatabaseExtensions.cs
File metadata and controls
30 lines (24 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using JetBrains.Annotations;
using Microsoft.Data.Entity.Infrastructure;
using Npgsql.EntityFramework7;
using Microsoft.Data.Entity.Utilities;
// ReSharper disable once CheckNamespace
namespace Microsoft.Data.Entity
{
public static class NpgsqlDatabaseExtensions
{
public static NpgsqlDatabase AsNpgsql([NotNull] this Database database)
{
Check.NotNull(database, nameof(database));
var npgsqlDatabase = database as NpgsqlDatabase;
if (npgsqlDatabase == null)
{
throw new InvalidOperationException(Strings.NpgsqlNotInUse);
}
return npgsqlDatabase;
}
}
}