本文整理汇总了C#中MyGeneration.dOOdads.BusinessEntity类的典型用法代码示例。如果您正苦于以下问题:C# BusinessEntity类的具体用法?C# BusinessEntity怎么用?C# BusinessEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BusinessEntity类属于MyGeneration.dOOdads命名空间,在下文中一共展示了BusinessEntity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SqlClientDynamicQuery
public SqlClientDynamicQuery(BusinessEntity entity)
: base(entity)
{
}
示例2: CreateDynamicQuery
internal abstract DynamicQuery CreateDynamicQuery(BusinessEntity entity);
示例3: Enlist
/// <summary>
/// Enlist by the dOOdads architecture when a IDbCommand (SqlCommand is an IDbCommand). The command may or may not be enrolled
/// in a transaction depending on whether or not BeginTransaction has been called. Each call to Enlist must be followed by a
/// call to <see cref="DeEnlist"/>.
/// </summary>
/// <param name="cmd">Your SqlCommand, OleDbCommand, etc ...</param>
/// <param name="entity">Your business entity, in C# use 'this', VB.NET use 'Me'.</param>
/// <example>
/// C#
/// <code>
/// txMgr.Enlist(cmd, this);
/// cmd.ExecuteNonQuery();
/// txMgr.DeEnlist(cmd, this);
/// </code>
/// VB.NET
/// <code>
/// txMgr.Enlist(cmd, Me)
/// cmd.ExecuteNonQuery()
/// txMgr.DeEnlist(cmd, Me)
/// </code>
/// </example>
public void Enlist(IDbCommand cmd, BusinessEntity entity)
{
if(txCount == 0 || entity._notRecommendedConnection != null)
{
// NotRecommendedConnections never play in dOOdad transactions
cmd.Connection = CreateSqlConnection(entity);
}
else
{
string connStr = entity._config;
if(entity._raw != "") connStr = entity._raw;
Transaction tx = this.transactions[connStr] as Transaction;
if(tx == null)
{
IDbConnection sqlConn = CreateSqlConnection(entity);
tx = new Transaction();
tx.sqlConnection = sqlConn;
if(_isolationLevel != IsolationLevel.Unspecified)
{
tx.sqlTx = sqlConn.BeginTransaction(_isolationLevel);
}
else
{
tx.sqlTx = sqlConn.BeginTransaction();
}
this.transactions[connStr] = tx;
}
cmd.Connection = tx.sqlConnection;
cmd.Transaction = tx.sqlTx;
}
}
示例4: CreateDynamicQuery
internal override DynamicQuery CreateDynamicQuery(BusinessEntity entity)
{
return new PostgreSqlDynamicQuery(entity);
}
示例5: OleDbDynamicQuery
public OleDbDynamicQuery(BusinessEntity entity)
: base(entity)
{
}
示例6: AggregateClause
public AggregateClause(BusinessEntity entity)
{
this._entity = entity;
}
示例7: CreateDynamicQuery
override internal DynamicQuery CreateDynamicQuery(BusinessEntity entity)
{
return new OracleClientDynamicQuery(entity);
}
示例8: CreateDynamicQuery
internal override DynamicQuery CreateDynamicQuery(BusinessEntity entity)
{
return new SQLiteDynamicQuery(entity);
}
示例9: CreateDynamicQuery
override internal DynamicQuery CreateDynamicQuery(BusinessEntity entity)
{
return new VistaDBDynamicQuery(entity);
}
示例10: OracleClientDynamicQuery
public OracleClientDynamicQuery(BusinessEntity entity)
: base(entity)
{
}
示例11: CreateSqlConnection
private IDbConnection CreateSqlConnection(BusinessEntity entity)
{
IDbConnection cn;
if(entity._notRecommendedConnection != null)
{
// This is assumed to be open
cn = entity._notRecommendedConnection;
}
else
{
cn = entity.CreateIDbConnection();
if(entity._raw != "")
cn.ConnectionString = entity._raw;
else
#if(VS2005)
cn.ConnectionString = ConfigurationManager.AppSettings[entity._config];
#else
cn.ConnectionString = ConfigurationSettings.AppSettings[entity._config];
#endif
cn.Open();
}
return cn;
}
示例12: AddBusinessEntity
/// <summary>
/// Called internally by BusinessEntity
/// </summary>
/// <param name="entity"></param>
internal void AddBusinessEntity(BusinessEntity entity)
{
if(this.objectsInTransaction == null)
{
this.objectsInTransaction = new ArrayList();
}
this.objectsInTransaction.Add(entity);
}
示例13: DeEnlist
/// <summary>
/// Each call to Enlist must be followed eventually by a call to DeEnlist.
/// </summary>
/// <param name="cmd"></param>
/// <param name="entity"></param>
/// <example>
/// C#
/// <code>
/// txMgr.Enlist(cmd, this);
/// cmd.ExecuteNonQuery();
/// txMgr.DeEnlist(cmd, this);
/// </code>
/// VB.NET
/// <code>>
/// txMgr.Enlist(cmd, Me)
/// cmd.ExecuteNonQuery()
/// txMgr.DeEnlist(cmd, Me)
/// </code>
/// </example>
public void DeEnlist(IDbCommand cmd, BusinessEntity entity)
{
if(entity._notRecommendedConnection != null)
{
// NotRecommendedConnection never play in dOOdad transactions
cmd.Connection = null;
}
else
{
if(txCount == 0)
{
cmd.Connection.Dispose();
}
}
}
示例14: VisualFoxProDynamicQuery
public VisualFoxProDynamicQuery(BusinessEntity entity) : base(entity) { }
示例15: CreateDynamicQuery
internal override DynamicQuery CreateDynamicQuery(BusinessEntity entity)
{
return new FirebirdSqlDynamicQuery(entity);
}