Exemple #1
0
 /// <summary>
 /// Inserts a new data in the database.
 /// </summary>
 /// <typeparam name="TResult">The target type of the result.</typeparam>
 /// <param name="entity">The data entity object to be inserted.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The value of the identity field if present, otherwise, the value of primary field.</returns>
 public TResult Insert <TResult>(TEntity entity,
                                 IDbTransaction transaction = null)
 {
     return(DbRepository.Insert <TEntity, TResult>(entity: entity,
                                                   transaction: transaction));
 }
Exemple #2
0
 /// <summary>
 /// Inserts a new data in the database.
 /// </summary>
 /// <param name="entity">The data entity object to be inserted.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The value of the identity field if present, otherwise, the value of primary field.</returns>
 public object Insert(TEntity entity,
                      IDbTransaction transaction = null)
 {
     return(DbRepository.Insert <TEntity>(entity: entity,
                                          transaction: transaction));
 }