FAManagementStudio.Models.DatabaseInfo.GetDomain C# (CSharp) Method

GetDomain() public method

public GetDomain ( FirebirdSql.Data.FirebirdClient.FbConnection con ) : IEnumerable
con FirebirdSql.Data.FirebirdClient.FbConnection
return IEnumerable
        public IEnumerable<DomainInfo> GetDomain(FbConnection con)
        {
            using (var command = con.CreateCommand())
            {
                command.CommandText =
                     $"select distinct f.rdb$field_type Type, f.rdb$field_sub_type SubType , f.rdb$character_length CharSize, trim(f.rdb$field_name) FieldName, f.rdb$field_precision FieldPrecision, f.rdb$field_scale FieldScale, f.rdb$field_length FieldLength, coalesce(f.rdb$validation_source, '') ValidationSource, coalesce(f.rdb$default_source, '') DefaultSource, f.rdb$null_flag NullFlag " +
                      "from rdb$fields f " +
                     $"where f.rdb$FIELD_NAME not starting with 'RDB$' and f.rdb$FIELD_NAME not starting with 'MON$' and f.rdb$FIELD_NAME not starting with 'SEC$' " +
                      "order by f.rdb$field_name; ";
                var reader = command.ExecuteReader();
                while (reader.Read())
                {
                    var name = (string)reader["FieldName"];
                    var size = (reader["CharSize"] == DBNull.Value) ? null : (short?)reader["CharSize"];
                    var subType = (reader["SubType"] == DBNull.Value) ? null : (short?)reader["SubType"];
                    var precision = (reader["FieldPrecision"] == DBNull.Value) ? null : (short?)reader["FieldPrecision"];
                    var scale = (reader["FieldScale"] == DBNull.Value) ? null : (short?)reader["FieldScale"];
                    var fieldLength = (reader["FieldLength"] == DBNull.Value) ? null : (short?)reader["FieldLength"];
                    var type = new FieldType((short)reader["Type"], subType, size, precision, scale, fieldLength);
                    var validationSource = (string)reader["ValidationSource"];
                    var defaultSource = (string)reader["DefaultSource"];
                    var nullFlag = reader["NullFlag"] == DBNull.Value;
                    yield return new DomainInfo(name, type, validationSource, defaultSource, nullFlag);
                }
            }
        }