You've already forked linux-packaging-mono
Imported Upstream version 5.2.0.179
Former-commit-id: a536d4f20e27294d8bbc2184d75f3a22364f7ba1
This commit is contained in:
parent
966bba02bb
commit
fad71374d0
161
external/entityframework/samples/Provider/SampleEntityFrameworkProvider/2.0 Provider Code/Command.cs
vendored
Normal file
161
external/entityframework/samples/Provider/SampleEntityFrameworkProvider/2.0 Provider Code/Command.cs
vendored
Normal file
@@ -0,0 +1,161 @@
|
||||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace SampleEntityFrameworkProvider
|
||||
{
|
||||
public partial class SampleCommand : DbCommand
|
||||
{
|
||||
internal DbCommand _WrappedCommand = new SqlCommand();
|
||||
|
||||
public SampleCommand()
|
||||
{
|
||||
}
|
||||
|
||||
public SampleCommand(string commandText)
|
||||
{
|
||||
this.InitializeMe(commandText, null, null);
|
||||
}
|
||||
|
||||
public SampleCommand(string commandText, SampleConnection connection)
|
||||
{
|
||||
this.InitializeMe(commandText, connection, null);
|
||||
}
|
||||
|
||||
public SampleCommand(string commandText, SampleConnection connection, DbTransaction transaction)
|
||||
{
|
||||
this.InitializeMe(commandText, connection, transaction);
|
||||
}
|
||||
|
||||
private void InitializeMe(string commandText, SampleConnection connection, DbTransaction transaction)
|
||||
{
|
||||
this.CommandText = commandText;
|
||||
this.Connection = connection;
|
||||
this.Transaction = transaction;
|
||||
}
|
||||
|
||||
public override void Cancel()
|
||||
{
|
||||
this._WrappedCommand.Cancel();
|
||||
}
|
||||
|
||||
public override string CommandText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._WrappedCommand.CommandText;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._WrappedCommand.CommandText = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override int CommandTimeout
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._WrappedCommand.CommandTimeout;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._WrappedCommand.CommandTimeout = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override CommandType CommandType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._WrappedCommand.CommandType;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._WrappedCommand.CommandType = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected override DbParameter CreateDbParameter()
|
||||
{
|
||||
return this._WrappedCommand.CreateParameter();
|
||||
}
|
||||
|
||||
private SampleConnection _Connection = null;
|
||||
protected override DbConnection DbConnection
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Connection;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._Connection = (SampleConnection) value;
|
||||
this._WrappedCommand.Connection = this._Connection._WrappedConnection;
|
||||
}
|
||||
}
|
||||
|
||||
protected override DbParameterCollection DbParameterCollection
|
||||
{
|
||||
get { return this._WrappedCommand.Parameters; }
|
||||
}
|
||||
|
||||
private DbTransaction _Transaction = null;
|
||||
protected override DbTransaction DbTransaction
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Transaction;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._Transaction = value;
|
||||
this._WrappedCommand.Transaction = this._Transaction;
|
||||
}
|
||||
}
|
||||
|
||||
private bool _DesignTimeVisible = true;
|
||||
public override bool DesignTimeVisible
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._DesignTimeVisible;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._DesignTimeVisible = value;
|
||||
}
|
||||
}
|
||||
protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior)
|
||||
{
|
||||
return this._WrappedCommand.ExecuteReader(behavior);
|
||||
}
|
||||
|
||||
public override int ExecuteNonQuery()
|
||||
{
|
||||
return this._WrappedCommand.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
public override object ExecuteScalar()
|
||||
{
|
||||
return this._WrappedCommand.ExecuteScalar();
|
||||
}
|
||||
|
||||
public override void Prepare()
|
||||
{
|
||||
this._WrappedCommand.Prepare();
|
||||
}
|
||||
|
||||
public override UpdateRowSource UpdatedRowSource
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._WrappedCommand.UpdatedRowSource;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._WrappedCommand.UpdatedRowSource = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace SampleEntityFrameworkProvider
|
||||
{
|
||||
public partial class SampleConnection : DbConnection, ICloneable
|
||||
{
|
||||
internal DbConnection _WrappedConnection = new SqlConnection();
|
||||
|
||||
public SampleConnection()
|
||||
{
|
||||
}
|
||||
|
||||
public SampleConnection(string connectionString)
|
||||
{
|
||||
this.ConnectionString = connectionString;
|
||||
}
|
||||
|
||||
public void ClearPool()
|
||||
{
|
||||
SqlConnection.ClearPool((SqlConnection)_WrappedConnection);
|
||||
}
|
||||
|
||||
protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel)
|
||||
{
|
||||
return this._WrappedConnection.BeginTransaction(isolationLevel);
|
||||
}
|
||||
|
||||
public override void ChangeDatabase(string databaseName)
|
||||
{
|
||||
this._WrappedConnection.ChangeDatabase(databaseName);
|
||||
}
|
||||
|
||||
public override void Close()
|
||||
{
|
||||
this._WrappedConnection.Close();
|
||||
}
|
||||
|
||||
public override string ConnectionString
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._WrappedConnection.ConnectionString;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._WrappedConnection.ConnectionString = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override int ConnectionTimeout
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._WrappedConnection.ConnectionTimeout;
|
||||
}
|
||||
}
|
||||
|
||||
protected override DbCommand CreateDbCommand()
|
||||
{
|
||||
DbCommand command = SampleFactory.Instance.CreateCommand();
|
||||
command.Connection = this;
|
||||
return command;
|
||||
}
|
||||
|
||||
public override string Database
|
||||
{
|
||||
get { return this._WrappedConnection.Database;}
|
||||
}
|
||||
|
||||
public override string DataSource
|
||||
{
|
||||
get { return this._WrappedConnection.DataSource; }
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
this._WrappedConnection.Dispose();
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
public override void EnlistTransaction(System.Transactions.Transaction transaction)
|
||||
{
|
||||
this._WrappedConnection.EnlistTransaction(transaction);
|
||||
}
|
||||
|
||||
public override DataTable GetSchema(string collectionName)
|
||||
{
|
||||
return this._WrappedConnection.GetSchema(collectionName);
|
||||
}
|
||||
|
||||
public override DataTable GetSchema()
|
||||
{
|
||||
return this._WrappedConnection.GetSchema();
|
||||
}
|
||||
|
||||
public override DataTable GetSchema(string collectionName, string[] restrictionValues)
|
||||
{
|
||||
return this._WrappedConnection.GetSchema(collectionName, restrictionValues);
|
||||
}
|
||||
|
||||
public override void Open()
|
||||
{
|
||||
this._WrappedConnection.Open();
|
||||
}
|
||||
|
||||
public override string ServerVersion
|
||||
{
|
||||
get { return this._WrappedConnection.ServerVersion; }
|
||||
}
|
||||
|
||||
public override System.ComponentModel.ISite Site
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._WrappedConnection.Site;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._WrappedConnection.Site = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override ConnectionState State
|
||||
{
|
||||
get { return this._WrappedConnection.State; }
|
||||
}
|
||||
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
SampleConnection clone = new SampleConnection();
|
||||
clone._WrappedConnection = (DbConnection) ((ICloneable) this._WrappedConnection).Clone();
|
||||
return clone;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace SampleEntityFrameworkProvider
|
||||
{
|
||||
public partial class SampleFactory : DbProviderFactory
|
||||
{
|
||||
public static readonly SampleFactory Instance = new SampleFactory();
|
||||
|
||||
public override bool CanCreateDataSourceEnumerator
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override DbCommand CreateCommand()
|
||||
{
|
||||
return new SampleCommand();
|
||||
}
|
||||
|
||||
public override DbCommandBuilder CreateCommandBuilder()
|
||||
{
|
||||
return new SqlCommandBuilder();
|
||||
}
|
||||
|
||||
public override DbConnection CreateConnection()
|
||||
{
|
||||
return new SampleConnection();
|
||||
}
|
||||
|
||||
public override DbConnectionStringBuilder CreateConnectionStringBuilder()
|
||||
{
|
||||
return new SqlConnectionStringBuilder();
|
||||
}
|
||||
|
||||
public override DbDataAdapter CreateDataAdapter()
|
||||
{
|
||||
return new SqlDataAdapter();
|
||||
}
|
||||
|
||||
public override DbDataSourceEnumerator CreateDataSourceEnumerator()
|
||||
{
|
||||
return System.Data.Sql.SqlDataSourceEnumerator.Instance;
|
||||
}
|
||||
|
||||
public override DbParameter CreateParameter()
|
||||
{
|
||||
return new SqlParameter();
|
||||
}
|
||||
|
||||
public override System.Security.CodeAccessPermission CreatePermission(System.Security.Permissions.PermissionState state)
|
||||
{
|
||||
return new SqlClientPermission(state);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user