FirebirdConvertFieldResolver
This class resolves a Field into a CAST(column AS TYPE) SQL fragment whenever the field carries an explicit .Type, using DbTypeToFirebirdStringNameResolver to determine the Firebird type name. It is used internally by FirebirdStatementBuilder and is not typically used directly.
Firebird’s
AVG()returns a value of the same exact-numeric type as its argument (e.g.AVG(INTEGER)is itselfINTEGER), truncating any fractional part instead of widening to a floating-point type the way MySQL/SQL Server do. BaseStatementBuilder already widens exact-numeric field types todoublebefore this resolver runs (viaClientTypeToAverageableClientTypeResolver), so Average/AverageAll cast toDOUBLE PRECISIONrather than truncating.
Usability
var resolver = new FirebirdConvertFieldResolver();
var expression = resolver.Resolve(new Field("Age", typeof(int)), dbSetting);
// CAST("Age" AS INTEGER)