DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
DatabaseExtensions.cs
Go to the documentation of this file.
1 using System;
2 using System.Data.Common;
3 using System.Linq;
4 
5 using Deveel.Data.Client;
6 
7 using IQToolkit.Data;
8 
9 namespace Deveel.Data.Linq {
10  public static class DatabaseExtensions {
11  public static IQueryProvider GetQueryProvider(this IDatabase database, ProviderSettings settings) {
12  var userName = settings.UserName;
13  var password = settings.Password;
14  var connection = (DbConnection) database.CreateDbConnection(userName, password);
15  var queryMapping = settings.MappingModel.CreateQueryMapping();
16 
17  return new DeveelDbProvider(connection, queryMapping, new EntityPolicy());
18  }
19  }
20 }
static IQueryProvider GetQueryProvider(this IDatabase database, ProviderSettings settings)
The representation of a single database in the system.
Definition: IDatabase.cs:40