Пример #1
0
        public async Task <long> InsertIdentityAsync(T entity, string[] excludeFields = null)
        {
            SqlProvider.FormatInsertIdentity(entity, excludeFields);
            object result = await DbCon.ExecuteScalarAsync(SqlProvider.SqlString, SqlProvider.Params, DbTransaction, isExcludeUnitOfWork : SqlProvider.IsExcludeUnitOfWork);

            return(result != null?Convert.ToInt64(result) : 0);
        }
Пример #2
0
        public int InsertIdentity(T entity)
        {
            SqlProvider.FormatInsertIdentity(entity);
            object result = DbCon.ExecuteScalar(SqlProvider.SqlString, SqlProvider.Params, DbTransaction);

            return(result != null?Convert.ToInt32(result) : 0);
        }
Пример #3
0
        public int InsertIdentity(T entity, string[] excludeFields = null)
        {
            SqlProvider.FormatInsertIdentity(entity, excludeFields);
            object result = DbCon.ExecuteScalar(SqlProvider.SqlString, SqlProvider.Params, DbTransaction, isExcludeUnitOfWork: SqlProvider.IsExcludeUnitOfWork);

            return(result != null?Convert.ToInt32(result) : 0);
        }