Esempio n. 1
0
        internal long GetIdentity()
        {
            var query = GetIncrementIdentity.Create(this);
            var sql   = query.Build(null);

            return(SqlHelper.ExecuteScalar <long>(this.ConnectionName, sql));
        }
Esempio n. 2
0
        internal long GetIdentity()
        {
            var query = GetIncrementIdentity.Create(this);
            var sql   = query.Build(null, this);

            if (this.IsEnabledMultiTenancy)
            {
                var param = new DynamicData();
                param.Add(GeneratedField.TenantIdName, AppSession.TenantId);
                return(SqlHelper.ExecuteScalar <long>(this.ConnectionName, sql, param));
            }
            else
            {
                return(SqlHelper.ExecuteScalar <long>(this.ConnectionName, sql));
            }
        }