Beispiel #1
0
        public static object GetMin(string fieldName, Transaction trans)
        {
            Command cmd = DbProvider.CreateCommand(string.Format(
                                                       "select {0} from {1}", DbProvider.Adapter.EnsureIdentifier(fieldName), EnsuredTableName));

            Where where = new Where();
            where.AddOrder(fieldName, OrderType.Asc);
            Builder.AppendWhereByEnsuredKey(cmd, where, KeyField.EnsuredName, DbProvider.Adapter);
            Builder.AppendPage(cmd, KeyField.Attribute.DbFieldName, TableName, new Page(0, 1), where, DbProvider.Adapter);
            return(Burst.Utils.DeserializeAs(
                       cmd.ExecuteScalar(trans),
                       _schema.Columns[fieldName].Type,
                       _schema.Columns[fieldName].SerializeType
                       ));
        }